scm_workspace 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scm_workspace/version.rb +1 -1
- data/lib/scm_workspace.rb +9 -0
- data/spec/scm_workspace_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93e04ad2ca71d982ce259e939b1d65d235d577d9
|
4
|
+
data.tar.gz: 069600e8925ec772288e75d2acfd6dda4d1dca8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7023147604b2e5682930bb5983de9663d431a877c6cf1fb2993b29b504a7c392ccb0a7aac5efc457bdeb3966e33400c0d55e1c8518d0f5e444cc0c9890337173
|
7
|
+
data.tar.gz: fbb3c66ce84559d612d493b2fcd76d48a3d45b1e984ff438c91c2d4d3b5f2f03868b8d8d8782045db83df434c42cfe41797dae021fe9ac44609d1112bcb33e00
|
data/lib/scm_workspace.rb
CHANGED
@@ -166,6 +166,15 @@ class ScmWorkspace
|
|
166
166
|
result
|
167
167
|
end
|
168
168
|
|
169
|
+
def commit_info
|
170
|
+
{
|
171
|
+
"scm_type" => scm_type.to_s,
|
172
|
+
"url" => url,
|
173
|
+
"branch" => current_branch_name,
|
174
|
+
"commit_key" => current_commit_key
|
175
|
+
}
|
176
|
+
end
|
177
|
+
|
169
178
|
def branch_names
|
170
179
|
return nil unless configured?
|
171
180
|
case scm_type
|
data/spec/scm_workspace_spec.rb
CHANGED
@@ -69,6 +69,15 @@ describe ScmWorkspace do
|
|
69
69
|
|
70
70
|
its(:current_commit_key){ should == "a0eaf8cca31080ca26edbae0daddaa9931edd6d6" }
|
71
71
|
|
72
|
+
its(:commit_info) do
|
73
|
+
should == {
|
74
|
+
"scm_type" => "git",
|
75
|
+
"url" => @url,
|
76
|
+
"branch" => "develop",
|
77
|
+
"commit_key" => "a0eaf8cca31080ca26edbae0daddaa9931edd6d6",
|
78
|
+
}
|
79
|
+
end
|
80
|
+
|
72
81
|
it :fetch do
|
73
82
|
@scm_workspace.fetch
|
74
83
|
end
|
@@ -190,6 +199,11 @@ describe ScmWorkspace do
|
|
190
199
|
# git svn だと SHAはcloneするたびに変わるので末尾のSVNのリビジョン番号をチェックします
|
191
200
|
its(:current_commit_key){ should =~ /\A[0-9a-f]{40}:247\Z/ }
|
192
201
|
|
202
|
+
it{ subject.commit_info["scm_type"] == "svn" }
|
203
|
+
it{ subject.commit_info["url"] == @url }
|
204
|
+
it{ subject.commit_info["branch"] == "trunk" }
|
205
|
+
it{ subject.commit_info["commit_key"] =~ /\A[0-9a-f]{40}:247\Z/ }
|
206
|
+
|
193
207
|
it :fetch do
|
194
208
|
@scm_workspace.fetch
|
195
209
|
end
|