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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c25ceeee6e8984c83a268cdd8f6ac77dbb4299b
4
- data.tar.gz: b96f3e482cfec6b779419148c546420c59ad112e
3
+ metadata.gz: 93e04ad2ca71d982ce259e939b1d65d235d577d9
4
+ data.tar.gz: 069600e8925ec772288e75d2acfd6dda4d1dca8f
5
5
  SHA512:
6
- metadata.gz: 8dc62a996961bd8607440029ce273e1fd73d8a819f5e58ebd2c30ca9833867a0cbef55fa0e04ad3c1d4b687904f1e2ea18f805c75b90548bd9e2bafc7e4ea3ed
7
- data.tar.gz: 86191e0cd85108c5826082ebf253d18d80e13059da7e843f50f2bf30b4abc3e7e4c58efce3add60d928dd56807503a7de25635f761cd739062c7c09fef673628
6
+ metadata.gz: 7023147604b2e5682930bb5983de9663d431a877c6cf1fb2993b29b504a7c392ccb0a7aac5efc457bdeb3966e33400c0d55e1c8518d0f5e444cc0c9890337173
7
+ data.tar.gz: fbb3c66ce84559d612d493b2fcd76d48a3d45b1e984ff438c91c2d4d3b5f2f03868b8d8d8782045db83df434c42cfe41797dae021fe9ac44609d1112bcb33e00
@@ -1,3 +1,3 @@
1
1
  class ScmWorkspace
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scm_workspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima