scm 0.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +3 -0
- data/.gitignore +2 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +4 -0
- data/LICENSE.txt +20 -0
- data/README.md +46 -0
- data/Rakefile +40 -0
- data/gemspec.yml +16 -0
- data/lib/scm/commits/commit.rb +64 -0
- data/lib/scm/commits/git.rb +62 -0
- data/lib/scm/commits/hg.rb +69 -0
- data/lib/scm/commits/svn.rb +12 -0
- data/lib/scm/git.rb +500 -0
- data/lib/scm/hg.rb +469 -0
- data/lib/scm/repository.rb +355 -0
- data/lib/scm/scm.rb +36 -0
- data/lib/scm/svn.rb +497 -0
- data/lib/scm/util.rb +65 -0
- data/lib/scm/version.rb +4 -0
- data/lib/scm.rb +4 -0
- data/scm.gemspec +131 -0
- data/spec/git_spec.rb +26 -0
- data/spec/helpers/scm.rb +19 -0
- data/spec/scm_spec.rb +8 -0
- data/spec/spec_helper.rb +13 -0
- metadata +107 -0
data/spec/git_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'scm/git'
|
3
|
+
|
4
|
+
describe Git do
|
5
|
+
describe "create" do
|
6
|
+
it "should create the directory, if it does not exist" do
|
7
|
+
repo = Git.create(directory('create_new_git_repo'))
|
8
|
+
|
9
|
+
repo.path.should be_directory
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should create a git repository" do
|
13
|
+
repo = Git.create(mkdir('init_git_repo'))
|
14
|
+
|
15
|
+
repo.path.join('.git').should be_directory
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should allow creating a bare git repository" do
|
19
|
+
repo = Git.create(mkdir('init_bare_git_repo'))
|
20
|
+
|
21
|
+
repo.path.entries.map(&:to_s).should be =~ %w[
|
22
|
+
branches config description HEAD hooks info objects refs
|
23
|
+
]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/helpers/scm.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Helpers
|
5
|
+
module SCM
|
6
|
+
ROOT_DIR = File.join(Dir.tmpdir,'scm')
|
7
|
+
|
8
|
+
def directory(name)
|
9
|
+
File.join(ROOT_DIR,name)
|
10
|
+
end
|
11
|
+
|
12
|
+
def mkdir(name)
|
13
|
+
path = directory(name)
|
14
|
+
|
15
|
+
FileUtils.mkdir_p(path)
|
16
|
+
return path
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/scm_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.pre1
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Postmodern
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-08-18 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ore-tasks
|
16
|
+
requirement: &18110220 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.4'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *18110220
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &18109620 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.4'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *18109620
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: yard
|
38
|
+
requirement: &18109100 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.7.0
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *18109100
|
47
|
+
description: SCM is a simple Ruby library for interacting with common SCMs, such as
|
48
|
+
Git, Mercurial (Hg) and SubVersion (SVN).
|
49
|
+
email: postmodern.mod3@gmail.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .document
|
55
|
+
- .gitignore
|
56
|
+
- .rspec
|
57
|
+
- .yardopts
|
58
|
+
- ChangeLog.md
|
59
|
+
- LICENSE.txt
|
60
|
+
- README.md
|
61
|
+
- Rakefile
|
62
|
+
- gemspec.yml
|
63
|
+
- lib/scm.rb
|
64
|
+
- lib/scm/commits/commit.rb
|
65
|
+
- lib/scm/commits/git.rb
|
66
|
+
- lib/scm/commits/hg.rb
|
67
|
+
- lib/scm/commits/svn.rb
|
68
|
+
- lib/scm/git.rb
|
69
|
+
- lib/scm/hg.rb
|
70
|
+
- lib/scm/repository.rb
|
71
|
+
- lib/scm/scm.rb
|
72
|
+
- lib/scm/svn.rb
|
73
|
+
- lib/scm/util.rb
|
74
|
+
- lib/scm/version.rb
|
75
|
+
- scm.gemspec
|
76
|
+
- spec/git_spec.rb
|
77
|
+
- spec/helpers/scm.rb
|
78
|
+
- spec/scm_spec.rb
|
79
|
+
- spec/spec_helper.rb
|
80
|
+
homepage: http://github.com/postmodern/scm
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 1.8.8
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: Ruby interface to common SCMs
|
105
|
+
test_files:
|
106
|
+
- spec/git_spec.rb
|
107
|
+
- spec/scm_spec.rb
|