ambethia-git-railed 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +24 -0
  2. data/bin/git-railed +10 -0
  3. data/lib/git-railed.rake +30 -0
  4. metadata +55 -0
@@ -0,0 +1,24 @@
1
+ = git-railed
2
+
3
+ <tt>git-railed</tt> is a simple script that creates a new rails app, initializes a
4
+ new git repository, moving the db config and setting up the ignores for you.
5
+
6
+ == Usage
7
+
8
+ As a gem:
9
+
10
+ sudo gem install ambethia-git-railed -s http://gems.github.com
11
+
12
+ git-railed my_app_name
13
+
14
+ As a sake task:
15
+
16
+ sake -i http://github.com/ambethia/git-railed/tree/master/lib/git-railed.rake?raw=true
17
+
18
+ sake git-railed APP=my_app_name
19
+
20
+ == Notes
21
+
22
+ Until I can figure out how (if it's even possible) to change the working
23
+ directory of the parent process, you'll have to <tt>cd my_app_name</tt> yourself
24
+ after running git-railed. Boo.
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'rake'
4
+
5
+ load File.dirname(__FILE__) + '/../lib/git-railed.rake'
6
+
7
+ # get the app name.
8
+ ENV['APP'] = ARGV[0]
9
+
10
+ Rake::Task["git-railed"].invoke
@@ -0,0 +1,30 @@
1
+ desc "Create rails and app and initialize a git repository"
2
+ task "git-railed" do
3
+ app = ENV["APP"]
4
+ ignore = <<EOF
5
+ .DS_Store
6
+ config/database.yml
7
+ coverage
8
+ db/*.sqlite3
9
+ doc/app/*
10
+ log/*.log
11
+ tmp/**/*
12
+ EOF
13
+
14
+ # generate the rails app.
15
+ system "rails #{app}"
16
+
17
+ Dir.chdir(app)
18
+
19
+ system "git init"
20
+
21
+ # exemplify the db config
22
+ system "mv config/database.yml config/database.example.yml"
23
+
24
+ # keep empty directorys in the respository
25
+ # by placing an empty .gitignore in them
26
+ system "find . -type d -empty -exec touch {}/.gitignore \\;"
27
+
28
+ # Make the initial commit.
29
+ system "git add . && git commit -m \"Initial commit of '#{app}'\""
30
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ambethia-git-railed
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - Jason L Perry
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-06-21 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: jasper@ambethia.com
18
+ executables:
19
+ - git-railed
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - README.rdoc
26
+ - bin/git-railed
27
+ - lib/git-railed.rake
28
+ has_rdoc: false
29
+ homepage:
30
+ post_install_message:
31
+ rdoc_options: []
32
+
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: "0"
40
+ version:
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ version:
47
+ requirements: []
48
+
49
+ rubyforge_project:
50
+ rubygems_version: 1.0.1
51
+ signing_key:
52
+ specification_version: 2
53
+ summary: Setup a new rails app, git repo, and all the initial prep in one step.
54
+ test_files: []
55
+