tmp-repo 1.0.0 → 1.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.
- checksums.yaml +7 -7
- data/History.txt +5 -0
- data/lib/tmp-repo/version.rb +1 -1
- data/lib/tmp-repo.rb +13 -3
- metadata +22 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e066d1d7a1f044005bf19bc3ddfd9dc7447ed053
|
4
|
+
data.tar.gz: 0c81d28c00cda365465cf1b58456afe60c016ddf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 571bdc29b37e937ff1789c9f3a384aee3137a4ee0aa469fc682f7f677d919eab8beb3e4e9ddd5a9ee626f8e207c5fa8aa840f38478a4d0a3a89b158be6dac95e
|
7
|
+
data.tar.gz: aff97032c388b37e86b05e1c99cbf351fb5986f83ab456174c6b23431cd6d3d0fb55e5fde97b238770c9a54c092cd19fa7e1049b1342341a3d7860a6c870465b
|
data/History.txt
CHANGED
data/lib/tmp-repo/version.rb
CHANGED
data/lib/tmp-repo.rb
CHANGED
@@ -6,13 +6,19 @@ require 'fileutils'
|
|
6
6
|
require 'securerandom'
|
7
7
|
|
8
8
|
class TmpRepo
|
9
|
+
DEFAULT_GIT_EXECUTABLE = 'git'
|
10
|
+
|
9
11
|
class GitError < StandardError; end
|
10
12
|
|
11
13
|
attr_reader :working_dir
|
12
14
|
|
13
|
-
def
|
15
|
+
def self.random_dir
|
16
|
+
File.join(Dir.tmpdir, SecureRandom.hex(16))
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(dir = nil)
|
14
20
|
@working_dir = Pathname(
|
15
|
-
|
21
|
+
dir || self.class.random_dir
|
16
22
|
)
|
17
23
|
|
18
24
|
FileUtils.mkdir_p(working_dir)
|
@@ -62,7 +68,7 @@ class TmpRepo
|
|
62
68
|
|
63
69
|
def git(command)
|
64
70
|
in_repo do
|
65
|
-
output =
|
71
|
+
output = `#{git_executable} #{command}`
|
66
72
|
|
67
73
|
if $?.exitstatus != 0
|
68
74
|
raise GitError, output
|
@@ -80,6 +86,10 @@ class TmpRepo
|
|
80
86
|
|
81
87
|
private
|
82
88
|
|
89
|
+
def git_executable
|
90
|
+
DEFAULT_GIT_EXECUTABLE
|
91
|
+
end
|
92
|
+
|
83
93
|
def parse_status(status_text)
|
84
94
|
lines = status_text.split("\n")
|
85
95
|
status_hash = create_status_hash
|
metadata
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmp-repo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
date: 2014-08-21 00:00:00 Z
|
11
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
|
-
|
15
|
-
|
16
|
-
email:
|
13
|
+
description: Creates and manages a git repository in the operating system's temporary
|
14
|
+
directory. Useful for running git operations in tests.
|
15
|
+
email:
|
17
16
|
- camertron@gmail.com
|
18
17
|
executables: []
|
19
|
-
|
20
18
|
extensions: []
|
21
|
-
|
22
19
|
extra_rdoc_files: []
|
23
|
-
|
24
|
-
files:
|
20
|
+
files:
|
25
21
|
- Gemfile
|
26
22
|
- History.txt
|
27
23
|
- README.md
|
@@ -33,29 +29,26 @@ files:
|
|
33
29
|
- tmp-repo.gemspec
|
34
30
|
homepage: http://github.com/camertron
|
35
31
|
licenses: []
|
36
|
-
|
37
32
|
metadata: {}
|
38
|
-
|
39
33
|
post_install_message:
|
40
34
|
rdoc_options: []
|
41
|
-
|
42
|
-
require_paths:
|
35
|
+
require_paths:
|
43
36
|
- lib
|
44
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
-
|
47
|
-
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
53
47
|
requirements: []
|
54
|
-
|
55
48
|
rubyforge_project:
|
56
49
|
rubygems_version: 2.2.2
|
57
50
|
signing_key:
|
58
51
|
specification_version: 4
|
59
|
-
summary: Creates and manages a git repository in the operating system's temporary
|
52
|
+
summary: Creates and manages a git repository in the operating system's temporary
|
53
|
+
directory. Useful for running git operations in tests.
|
60
54
|
test_files: []
|
61
|
-
|