scm_workspace 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93e04ad2ca71d982ce259e939b1d65d235d577d9
4
- data.tar.gz: 069600e8925ec772288e75d2acfd6dda4d1dca8f
3
+ metadata.gz: 99dc52c5c303b85855a5926f2f2be19af620b793
4
+ data.tar.gz: 15b8d698f5d4a5d7d4970158093309472d635e13
5
5
  SHA512:
6
- metadata.gz: 7023147604b2e5682930bb5983de9663d431a877c6cf1fb2993b29b504a7c392ccb0a7aac5efc457bdeb3966e33400c0d55e1c8518d0f5e444cc0c9890337173
7
- data.tar.gz: fbb3c66ce84559d612d493b2fcd76d48a3d45b1e984ff438c91c2d4d3b5f2f03868b8d8d8782045db83df434c42cfe41797dae021fe9ac44609d1112bcb33e00
6
+ metadata.gz: 0a09fe9bf444998f0bafa1c702aa6f4a9cb9b90e0c760dc2aa349abee70392df00fc3f2d9a99dfeca0e3c7b85d74555d301f4c731e851850c8d34545de06e217
7
+ data.tar.gz: d223c163a460ea1d96efb6e3afdf747c4f853debcb332fe8a41061c61d4517a0a82cd79915e68525795c793733c62bdef3571c4ab70e5c837ba560f99bee70a6
@@ -1,3 +1,3 @@
1
1
  class ScmWorkspace
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/scm_workspace.rb CHANGED
@@ -263,6 +263,10 @@ class ScmWorkspace
263
263
  !configured?
264
264
  end
265
265
 
266
+ def contains?(obj)
267
+ !!system_at_root!("git show #{obj} --oneline --quiet") rescue false
268
+ end
269
+
266
270
  CONFIGURE_OPTIONS = {
267
271
  svn: {
268
272
  "A" => "authors_file",
@@ -78,6 +78,13 @@ describe ScmWorkspace do
78
78
  }
79
79
  end
80
80
 
81
+ it{ subject.contains?("a0eaf8cca31080ca26edbae0daddaa9931edd6d6").should be_true }
82
+ it{ subject.contains?("v0.0.2").should be_true }
83
+ it{ subject.contains?("v0.0.0").should be_false }
84
+ # it{ subject.contains?("master").should be_true }
85
+ it{ subject.contains?("develop").should be_true }
86
+ it{ subject.contains?("removed").should be_false }
87
+
81
88
  it :fetch do
82
89
  @scm_workspace.fetch
83
90
  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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - akima