meskyanichi-generators 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/CHANGELOG CHANGED
@@ -1,5 +1,22 @@
1
1
 
2
- Meskyanichi - Generators |0.0.2|
2
+ Meskyanichi - Generators |0.2.0|
3
+ -----------------------------------------------------------
4
+
5
+ - Added Git Template Generator
6
+ - Added Git Dependencies
7
+ - Updated the README
8
+
9
+ -----------------------------------------------------------
10
+
11
+ Meskyanichi - Generators |0.1.1|
12
+ -----------------------------------------------------------
13
+
14
+ - Fixed dependencies
15
+
16
+ -----------------------------------------------------------
17
+
18
+
19
+ Meskyanichi - Generators |0.1.0|
3
20
  -----------------------------------------------------------
4
21
 
5
22
  - Finished "capistrano_template"
data/README.rdoc CHANGED
@@ -84,8 +84,41 @@ After you've setup Capistrano correctly using the cap deploy:setup, you may now
84
84
 
85
85
 
86
86
 
87
- == Git (Coming Soon!)
87
+ == The Git Template
88
88
 
89
+ The git template is quite simple. What it does, is it generates a bunch of .gitignore files to fill up a newly generated Rails application so git itself will be able to commit the whole application, including the directories which are normally empty. So you basically won't have to add these files manually everytime you start a new project, since it's simply boring.
90
+
91
+ The other thing the script does is generate the main .gitignore file in the root of the Rails application, containing some default ignore rules, which usually, at least when starting, is sufficient.
92
+
93
+ The following script will initialize git, creating, or reinitializing a local repository and generate all the files, including the main .gitignore file in the root with the default ignoration rules:
94
+
95
+ script/generate git_template
96
+
97
+ So now, if you wish, you can manually add some additional ignoration rules, by opening the .gitignore which is located in the root of your application. You can also already add them by including arguments in the generate command, like so:
98
+
99
+ script/generate git_template path/to/file1.rb path/to/file2.rb path/to/some_files/*.rb
100
+
101
+ The command above will allow you, without going into the .gitignore file manually, to add additional rules during the generation process.
102
+
103
+ After the whole script has run, you will most likely want to add a remote repository, do this as usual with the following command:
104
+
105
+ git remote add origin #{path_to_remote_repository.git}
106
+
107
+ Now, add, commit and push the files to your remote server like so:
108
+
109
+ git add .
110
+ git commit -a -m "Initial Commit"
111
+ git push origin master
112
+
113
+ Congratulations, your application now has a local and remote repository.
114
+
115
+ The default ignoration rules that are added to the main .gitignore file located in the root of your Rails application are:
116
+
117
+ .DS_Store
118
+ log/*.log
119
+ tmp/**/*
120
+ config/database.yml
121
+ db/*.sqlite3
89
122
 
90
123
  == Copyright
91
124
 
data/Rakefile CHANGED
@@ -10,8 +10,8 @@ begin
10
10
  gem.homepage = "http://github.com/meskyanichi/generators"
11
11
  gem.authors = ["Michael"]
12
12
  gem.add_dependency('capistrano')
13
-
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
13
+ gem.add_dependency('git')
14
+ gem.add_dependency('git-rails')
15
15
  end
16
16
  rescue LoadError
17
17
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 1
4
- :patch: 1
3
+ :minor: 2
4
+ :patch: 0
@@ -0,0 +1,53 @@
1
+ class GitTemplateGenerator < Rails::Generator::Base
2
+
3
+ def initialize(runtime_args, runtime_options = {})
4
+ super
5
+
6
+ system "git init"
7
+
8
+ @all_ignorations = [
9
+ '.DS_Store',
10
+ 'log/*.log',
11
+ 'tmp/**/*',
12
+ 'config/database.yml',
13
+ 'db/*.sqlite3']
14
+
15
+ @all_ignorations += @args unless @args.empty?
16
+ end
17
+
18
+ def manifest
19
+ record do |m|
20
+ for location in locations
21
+ m.file 'git_ignore_empty.txt', "#{location}/.gitignore"
22
+ end
23
+ m.template 'git_ignore_template.txt.erb', '.gitignore'
24
+ end
25
+ end
26
+
27
+ def locations
28
+ ['app/models',
29
+ 'app/views',
30
+ 'app/views/layouts',
31
+ 'db',
32
+ 'lib',
33
+ 'lib/tasks',
34
+ 'public/javascripts',
35
+ 'public/stylesheets',
36
+ 'test/fixtures',
37
+ 'test/functional',
38
+ 'test/integration',
39
+ 'test/unit',
40
+ 'tmp',
41
+ 'tmp/cache',
42
+ 'tmp/pids',
43
+ 'tmp/sessions',
44
+ 'tmp/sockets',
45
+ 'vendor',
46
+ 'vendor/plugins']
47
+ end
48
+
49
+ def all_ignorations
50
+ @all_ignorations
51
+ end
52
+
53
+ end
@@ -0,0 +1,3 @@
1
+ <% for ignoration in all_ignorations -%>
2
+ <%= ignoration %>
3
+ <% end -%>
@@ -0,0 +1,65 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{generators}
5
+ s.version = "0.2.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Michael"]
9
+ s.date = %q{2009-06-03}
10
+ s.email = %q{meskyan@gmail.com}
11
+ s.extra_rdoc_files = [
12
+ "LICENSE",
13
+ "README.rdoc"
14
+ ]
15
+ s.files = [
16
+ ".document",
17
+ ".gitignore",
18
+ "CHANGELOG",
19
+ "LICENSE",
20
+ "README.rdoc",
21
+ "Rakefile",
22
+ "VERSION.yml",
23
+ "generators.gemspec",
24
+ "lib/generators.rb",
25
+ "test/generators_test.rb",
26
+ "test/test_helper.rb",
27
+ "generators",
28
+ "generators/capistrano_template",
29
+ "generators/capistrano_template/capistrano_template_generator.rb",
30
+ "generators/capistrano_template/templates/deploy.rb",
31
+ "generators/git_template",
32
+ "generators/git_template/git_template_generator.rb",
33
+ "generators/git_template/templates/git_ignore_empty.txt",
34
+ "generators/git_template/templates/git_ignore_template.txt.erb"
35
+ ]
36
+ s.has_rdoc = true
37
+ s.homepage = %q{http://github.com/meskyanichi/generators}
38
+ s.rdoc_options = ["--charset=UTF-8"]
39
+ s.require_paths = ["lib"]
40
+ s.rubygems_version = %q{1.3.1}
41
+ s.summary = %q{A generator gem that helps you get up and running just a little bit faster!}
42
+ s.test_files = [
43
+ "test/generators_test.rb",
44
+ "test/test_helper.rb"
45
+ ]
46
+
47
+ if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
49
+ s.specification_version = 2
50
+
51
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<capistrano>, [">= 0"])
53
+ s.add_runtime_dependency(%q<git>, [">= 0"])
54
+ s.add_runtime_dependency(%q<git-rails>, [">= 0"])
55
+ else
56
+ s.add_dependency(%q<capistrano>, [">= 0"])
57
+ s.add_dependency(%q<git>, [">= 0"])
58
+ s.add_dependency(%q<git-rails>, [">= 0"])
59
+ end
60
+ else
61
+ s.add_dependency(%q<capistrano>, [">= 0"])
62
+ s.add_dependency(%q<git>, [">= 0"])
63
+ s.add_dependency(%q<git-rails>, [">= 0"])
64
+ end
65
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meskyanichi-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-02 00:00:00 -07:00
12
+ date: 2009-06-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,6 +22,26 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: "0"
24
24
  version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: git
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: git-rails
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
25
45
  description:
26
46
  email: meskyan@gmail.com
27
47
  executables: []
@@ -32,18 +52,25 @@ extra_rdoc_files:
32
52
  - LICENSE
33
53
  - README.rdoc
34
54
  files:
55
+ - .document
56
+ - .gitignore
57
+ - CHANGELOG
35
58
  - LICENSE
36
59
  - README.rdoc
37
60
  - Rakefile
38
61
  - VERSION.yml
62
+ - generators.gemspec
39
63
  - lib/generators.rb
40
64
  - test/generators_test.rb
41
65
  - test/test_helper.rb
42
- - CHANGELOG
43
- - rails_generators
44
- - rails_generators/capistrano_template
45
- - rails_generators/capistrano_template/capistrano_template_generator.rb
46
- - rails_generators/capistrano_template/templates/deploy.rb
66
+ - generators
67
+ - generators/capistrano_template
68
+ - generators/capistrano_template/capistrano_template_generator.rb
69
+ - generators/capistrano_template/templates/deploy.rb
70
+ - generators/git_template
71
+ - generators/git_template/git_template_generator.rb
72
+ - generators/git_template/templates/git_ignore_empty.txt
73
+ - generators/git_template/templates/git_ignore_template.txt.erb
47
74
  has_rdoc: true
48
75
  homepage: http://github.com/meskyanichi/generators
49
76
  post_install_message: