highgroove_generator 0.1.0

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 ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in highgroove-generator.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Aubrey Rhodes
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Highgroove-Generator
2
+
3
+ Generate Rails projects the way we like them.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ gem install highgroove-generator
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ highgroove
15
+ ```
16
+
17
+ ## Contributing
18
+
19
+ 1. Fork it
20
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
21
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
22
+ 4. Push to the branch (`git push origin my-new-feature`)
23
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/highgroove ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/highgroove_command'
3
+
4
+ HighgrooveCommand.start
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/highgroove-generator/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Aubrey Rhodes"]
6
+ gem.email = ["aubrey.c.rhodes@gmail.com"]
7
+ gem.description = %q{Tool to generate a rails project ready for development}
8
+ gem.summary = %q{Highgroove rails project generator}
9
+ gem.homepage = "http://github.com/highgroove/highgroove-generator"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "highgroove_generator"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Highgroove::Generator::VERSION
17
+
18
+ gem.add_dependency "rails"
19
+ gem.add_dependency "thor"
20
+ end
@@ -0,0 +1,5 @@
1
+ module Highgroove
2
+ module Generator
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "highgroove-generator/version"
2
+
3
+ module Highgroove
4
+ module Generator
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,67 @@
1
+ require "thor"
2
+
3
+ class HighgrooveCommand < Thor
4
+ include Thor::Actions
5
+
6
+ desc "new NAME", "Generates a new project with the given name"
7
+ method_option :database, type: :string, default: 'postgresql', aliases: '-d'
8
+ def new(name)
9
+ run "rails new #{name} --skip-bundle -T -q -d #{options[:database]}"
10
+ inside name do
11
+ run "git init -q"
12
+ gsub_file "Gemfile", /^ *#.*$/, ''
13
+ gsub_file "Gemfile", /^ *$\n/, ''
14
+ append_to_file "Gemfile" do
15
+ <<-EOF
16
+ gem 'slim'
17
+ group :test, :development do
18
+ gem 'rspec-rails'
19
+ gem 'factory_girl'
20
+ gem 'forgery'
21
+ end
22
+ group :test do
23
+ gem 'capybara'
24
+ gem 'launchy'
25
+ gem 'database_cleaner'
26
+ gem 'capybara-webkit'
27
+ gem 'simplecov'
28
+ end
29
+ EOF
30
+ end
31
+ run "bundle install --quiet"
32
+ run "rails g rspec:install"
33
+ run "rails g forgery"
34
+ insert_into_file 'spec/spec_helper.rb', "\nrequire 'capybara/rspec'", after: "require 'rspec/autorun'"
35
+ gsub_file 'spec/spec_helper.rb', / *# Remove this[^\n]*\n *config\.fixture_path[^\n]*\n\n/m, ''
36
+ gsub_file 'spec/spec_helper.rb', /config.use_transactional_fixtures = true/, 'config.use_transactional_fixture = false'
37
+ insert_into_file 'spec/spec_helper.rb', after: "config.infer_base_class_for_anonymous_controllers = false\n" do
38
+ <<-EOF
39
+
40
+ config.before(:suite) do
41
+ DatabaseCleaner.strategy = :truncation
42
+ end
43
+
44
+ config.before(:each) do
45
+ DatabaseCleaner.start
46
+ end
47
+
48
+ config.after(:each) do
49
+ DatabaseCleaner.clean
50
+ end
51
+ EOF
52
+ end
53
+ append_to_file 'spec/spec_helper.rb', "\nCapybara.javascript_driver = :webkit\n"
54
+ prepend_to_file 'spec/spec_helper.rb' do
55
+ <<-EOF
56
+ require 'simplecov'
57
+ SimpleCov.start
58
+
59
+ EOF
60
+ end
61
+ append_to_file '.gitignore', "\ncoverage\n.rvmrc"
62
+ remove_file 'public/index.html'
63
+ gsub_file 'config/database.yml', /username: .*$/, 'username:'
64
+ run 'rake db:create'
65
+ end
66
+ end
67
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: highgroove_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Aubrey Rhodes
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70328832627860 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70328832627860
25
+ - !ruby/object:Gem::Dependency
26
+ name: thor
27
+ requirement: &70328832627280 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70328832627280
36
+ description: Tool to generate a rails project ready for development
37
+ email:
38
+ - aubrey.c.rhodes@gmail.com
39
+ executables:
40
+ - highgroove
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - .gitignore
45
+ - Gemfile
46
+ - LICENSE
47
+ - README.md
48
+ - Rakefile
49
+ - bin/highgroove
50
+ - highgroove-generator.gemspec
51
+ - lib/highgroove-generator.rb
52
+ - lib/highgroove-generator/version.rb
53
+ - lib/highgroove_command.rb
54
+ homepage: http://github.com/highgroove/highgroove-generator
55
+ licenses: []
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ segments:
67
+ - 0
68
+ hash: 1729644340331381826
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ segments:
76
+ - 0
77
+ hash: 1729644340331381826
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 1.8.15
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: Highgroove rails project generator
84
+ test_files: []