rugs 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ .DS_STORE
2
+ .bundle
3
+ *.gem
4
+ .bundle
5
+ Gemfile.lock
6
+ /rdoc
7
+ /doc
8
+ /pkg
9
+ *.tmproj
10
+ *.log
11
+ /log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rugs.gemspec
4
+ gemspec
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
@@ -0,0 +1,5 @@
1
+ require "rugs/version"
2
+ require "rugs/git"
3
+ require "rugs/client"
4
+ require "rugs/server"
5
+
@@ -0,0 +1,14 @@
1
+ require 'fileutils'
2
+
3
+ module RUGS
4
+
5
+ class Client
6
+
7
+ def self.create(repo_name)
8
+ Git.init(repo_name) unless Dir.exists?("#{repo_name}/.git")
9
+ FileUtils.mkdir_p "#{repo_name}/git_hooks"
10
+ end
11
+
12
+ end
13
+
14
+ end
@@ -0,0 +1,7 @@
1
+ module RUGS
2
+
3
+ class FileEvents
4
+
5
+ end
6
+
7
+ end
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
@@ -0,0 +1,9 @@
1
+ require 'fileutils'
2
+
3
+ module RUGS
4
+
5
+ class Server
6
+
7
+ end
8
+
9
+ end
@@ -0,0 +1,3 @@
1
+ module RUGS
2
+ VERSION = "0.0.1"
3
+ end
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
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+ require 'fileutils'
3
+
4
+ describe RUGS::Server do
5
+ let(:server) {RUGS::Server.new}
6
+
7
+ context 'When creating repos' do
8
+
9
+ end
10
+
11
+ after(:all) {FileUtils.rm_rf TEMP}
12
+
13
+ end
@@ -0,0 +1,10 @@
1
+ $: << '.'
2
+ $:.unshift File.expand_path(File.join(File.dirname(__FILE__), "/../lib"))
3
+ require 'rspec'
4
+ require 'rugs'
5
+
6
+ TEMP = "temp_rspec"
7
+
8
+ def temp_name(length=8)
9
+ "#{TEMP}/" + length.times.map{('a'..'z').to_a.sample}.join
10
+ end
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