rugs 0.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.
- data/.gitignore +11 -0
- data/Gemfile +4 -0
- data/README.markdown +20 -0
- data/Rakefile +1 -0
- data/autotest/discover.rb +1 -0
- data/lib/rugs.rb +5 -0
- data/lib/rugs/client.rb +14 -0
- data/lib/rugs/file_events.rb +7 -0
- data/lib/rugs/git.rb +16 -0
- data/lib/rugs/server.rb +9 -0
- data/lib/rugs/version.rb +3 -0
- data/rugs.gemspec +25 -0
- data/spec/rugs/client_spec.rb +26 -0
- data/spec/rugs/git_spec.rb +21 -0
- data/spec/rugs/server_spec.rb +13 -0
- data/spec/spec_helper.rb +10 -0
- metadata +76 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# RUGS - RUby Git Setup
|
2
|
+
|
3
|
+
A helper script that makes setting up git repositories a snap.
|
4
|
+
|
5
|
+
RUGS has three main functions:
|
6
|
+
|
7
|
+
* Creates a local git repository using default templates or ones you create.
|
8
|
+
* Sets up a remote repository to mirror your local one.
|
9
|
+
* Adds a framework of git hooks allowing you to store and run your own hooks in directly from the repo.
|
10
|
+
|
11
|
+
RUGS makes creating remote repos as simple as `rugs create repo_name on server_name`. If you have a default server set you don't even have to specify the server you can just run `rugs create repo_name`.
|
12
|
+
|
13
|
+
RUGS even allows you to automatically embed your Git hooks in the repo itself. No more jumping through hoops to make sure your hooks are maintained with your project; with RUGS you just store your hook scripts in the `git_hooks` directory and they're automatically updated and run.
|
14
|
+
|
15
|
+
Once you've set up your project using RUGS you just use Git as you normally would with the exception of your hooks being the in `git_hooks` directory.
|
16
|
+
|
17
|
+
## Status
|
18
|
+
|
19
|
+
**In Development**
|
20
|
+
Beginning development.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1 @@
|
|
1
|
+
Autotest.add_discovery {"rspec2"}
|
data/lib/rugs.rb
ADDED
data/lib/rugs/client.rb
ADDED
data/lib/rugs/git.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
3
|
+
module RUGS
|
4
|
+
|
5
|
+
# a very dumb wrapper for git
|
6
|
+
class Git
|
7
|
+
|
8
|
+
def self.method_missing(meth, args)
|
9
|
+
out, status = Open3.capture2e("git", meth.to_s, args)
|
10
|
+
raise Object::Exception(out) if status.exitstatus != 0
|
11
|
+
out
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/lib/rugs/server.rb
ADDED
data/lib/rugs/version.rb
ADDED
data/rugs.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "rugs/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rugs"
|
7
|
+
s.version = RUGS::VERSION
|
8
|
+
s.authors = ["Mike Bethany"]
|
9
|
+
s.email = ["mikbe.tk@gmail.com"]
|
10
|
+
s.homepage = "http://mikbe.tk"
|
11
|
+
s.summary = %q{Place holder gem}
|
12
|
+
s.description = %q{Nothing to see here, move along.}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
# specify any dependencies here; for example:
|
20
|
+
# s.add_development_dependency "rspec"
|
21
|
+
s.add_development_dependency "rspec"
|
22
|
+
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
describe RUGS::Client do
|
5
|
+
|
6
|
+
let(:client) {RUGS::Client}
|
7
|
+
|
8
|
+
context 'When creating repos' do
|
9
|
+
|
10
|
+
let(:repo_name) {temp_name}
|
11
|
+
|
12
|
+
it 'should create a git repo' do
|
13
|
+
client.create repo_name
|
14
|
+
Dir.exists?(repo_name).should be_true
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should create a git_hooks directory in the local repo' do
|
18
|
+
client.create repo_name
|
19
|
+
Dir.exists?("#{repo_name}/git_hooks").should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
after(:all) {FileUtils.rm_rf TEMP}
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
describe RUGS::Git do
|
5
|
+
|
6
|
+
let(:git) {RUGS::Git}
|
7
|
+
|
8
|
+
it 'should run commands git knows' do
|
9
|
+
repo_name = temp_name
|
10
|
+
git.init(repo_name).should include("Initialized empty Git repository")
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should not run commands git does not know' do
|
14
|
+
repo_name = temp_name
|
15
|
+
expect{git.unicorn_and_rainbows(repo_name)}.should
|
16
|
+
raise_error(Object::Exception)
|
17
|
+
end
|
18
|
+
|
19
|
+
after(:all) {FileUtils.rm_rf TEMP}
|
20
|
+
|
21
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rugs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mike Bethany
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-09-23 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &2152139360 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2152139360
|
25
|
+
description: Nothing to see here, move along.
|
26
|
+
email:
|
27
|
+
- mikbe.tk@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- README.markdown
|
35
|
+
- Rakefile
|
36
|
+
- autotest/discover.rb
|
37
|
+
- lib/rugs.rb
|
38
|
+
- lib/rugs/client.rb
|
39
|
+
- lib/rugs/file_events.rb
|
40
|
+
- lib/rugs/git.rb
|
41
|
+
- lib/rugs/server.rb
|
42
|
+
- lib/rugs/version.rb
|
43
|
+
- rugs.gemspec
|
44
|
+
- spec/rugs/client_spec.rb
|
45
|
+
- spec/rugs/git_spec.rb
|
46
|
+
- spec/rugs/server_spec.rb
|
47
|
+
- spec/spec_helper.rb
|
48
|
+
homepage: http://mikbe.tk
|
49
|
+
licenses: []
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 1.8.10
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: Place holder gem
|
72
|
+
test_files:
|
73
|
+
- spec/rugs/client_spec.rb
|
74
|
+
- spec/rugs/git_spec.rb
|
75
|
+
- spec/rugs/server_spec.rb
|
76
|
+
- spec/spec_helper.rb
|