h2ocube_generator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.travis.yml +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +5 -0
- data/Rakefile +11 -0
- data/bin/h2ocube_generator +9 -0
- data/h2ocube_generator.gemspec +21 -0
- data/lib/h2ocube_generator.rb +7 -0
- data/lib/h2ocube_generator/app_builder.rb +34 -0
- data/lib/h2ocube_generator/app_generator.rb +9 -0
- data/source/Gemfile.erb +50 -0
- data/source/README.md.erb +3 -0
- data/source/config/application.rb.erb +32 -0
- data/source/config/environments/development.rb.erb +30 -0
- data/source/config/environments/production.rb.erb +60 -0
- data/source/config/environments/test.rb.erb +34 -0
- data/source/config/mongoid.yml.erb +21 -0
- metadata +102 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 h2ocube.com
|
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
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
desc 'Runs all testcases'
|
5
|
+
task :test do
|
6
|
+
require File.realpath('lib/h2ocube_generate.rb')
|
7
|
+
require 'test/unit'
|
8
|
+
Dir['test/*_test.rb'].each{ |f| require File.realpath(f) }
|
9
|
+
end
|
10
|
+
|
11
|
+
task :default => :test
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(File.join('..', 'lib', 'h2ocube_generator.rb'), File.dirname(__FILE__))
|
4
|
+
|
5
|
+
source_root = File.expand_path(File.join('..', 'source'), File.dirname(__FILE__))
|
6
|
+
|
7
|
+
H2ocubeGenerator::AppGenerator.source_root source_root
|
8
|
+
H2ocubeGenerator::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << source_root
|
9
|
+
H2ocubeGenerator::AppGenerator.start
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'h2ocube_generator'
|
7
|
+
gem.version = '0.0.1'
|
8
|
+
gem.authors = ['Ben']
|
9
|
+
gem.email = ['ben@h2ocube.com']
|
10
|
+
gem.description = %q{ H2ocube Generator is the base Rails application builder. }
|
11
|
+
gem.summary = %q{ H2ocube Generator is the base Rails application builder. }
|
12
|
+
gem.homepage = ""
|
13
|
+
|
14
|
+
gem.files = `git ls-files`.split($/)
|
15
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.require_paths = ['lib']
|
18
|
+
|
19
|
+
gem.add_dependency 'rails', '>= 3.2'
|
20
|
+
gem.add_dependency 'bundler', '>= 1.1'
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class H2ocubeGenerator::AppBuilder < Rails::AppBuilder
|
2
|
+
def readme
|
3
|
+
template 'README.md.erb', 'README.md'
|
4
|
+
end
|
5
|
+
|
6
|
+
def gemfile
|
7
|
+
template 'Gemfile.erb', 'Gemfile'
|
8
|
+
end
|
9
|
+
|
10
|
+
def database_yml
|
11
|
+
template 'config/mongoid.yml.erb', 'config/mongoid.yml'
|
12
|
+
end
|
13
|
+
|
14
|
+
def config
|
15
|
+
empty_directory 'config'
|
16
|
+
|
17
|
+
inside 'config' do
|
18
|
+
template 'routes.rb'
|
19
|
+
template 'application.rb.erb', 'application.rb'
|
20
|
+
template 'environment.rb'
|
21
|
+
|
22
|
+
empty_directory 'environments'
|
23
|
+
|
24
|
+
inside 'environments' do
|
25
|
+
template 'development.rb.erb', 'development.rb'
|
26
|
+
template 'test.rb.erb', 'test.rb'
|
27
|
+
template 'production.rb.erb', 'production.rb'
|
28
|
+
end
|
29
|
+
|
30
|
+
directory 'initializers'
|
31
|
+
directory 'locales'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/source/Gemfile.erb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
gem 'rails' # http://api.rubyonrails.org/
|
4
|
+
|
5
|
+
# db
|
6
|
+
gem 'mongoid' # http://mongoid.org
|
7
|
+
|
8
|
+
# auth
|
9
|
+
gem 'devise' # https://github.com/plataformatec/devise
|
10
|
+
gem 'devise-async'
|
11
|
+
gem 'cancan' # https://github.com/ryanb/cancan
|
12
|
+
|
13
|
+
# upload
|
14
|
+
gem 'rest-client'
|
15
|
+
gem 'carrierwave-upyun' # https://github.com/nowa/carrierwave-upyun
|
16
|
+
|
17
|
+
# assets
|
18
|
+
gem 'slim' # https://github.com/stonean/slim
|
19
|
+
group :assets do
|
20
|
+
gem 'sass-rails', '~> 3.2.3'
|
21
|
+
gem 'compass'
|
22
|
+
gem 'coffee-rails', '~> 3.2.1'
|
23
|
+
gem 'therubyracer'
|
24
|
+
gem 'uglifier', '>= 1.0.3'
|
25
|
+
gem 'bootstrap-sass-rails' # https://github.com/yabawock/bootstrap-sass-rails
|
26
|
+
gem 'jquery-rails'
|
27
|
+
gem 'quiet_assets'
|
28
|
+
end
|
29
|
+
|
30
|
+
# helper
|
31
|
+
gem 'zfben_rails_rake'
|
32
|
+
gem 'garelic' # https://github.com/jsuchal/garelic
|
33
|
+
|
34
|
+
# queue
|
35
|
+
gem 'sidekiq' # http://mperham.github.com/sidekiq/
|
36
|
+
gem 'whenever', require: false
|
37
|
+
|
38
|
+
group :development, :test do
|
39
|
+
gem 'database_cleaner'
|
40
|
+
gem 'rspec-rails'
|
41
|
+
gem 'factory_girl_rails' # https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md
|
42
|
+
gem 'capybara'
|
43
|
+
gem 'thin'
|
44
|
+
gem 'capistrano', require: false
|
45
|
+
gem 'rvm-capistrano', require: false
|
46
|
+
end
|
47
|
+
|
48
|
+
group :production do
|
49
|
+
gem 'unicorn'
|
50
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'action_controller/railtie'
|
4
|
+
require 'action_mailer/railtie'
|
5
|
+
require 'active_resource/railtie'
|
6
|
+
|
7
|
+
if defined?(Bundler)
|
8
|
+
Bundler.require(:default, :assets, Rails.env)
|
9
|
+
end
|
10
|
+
|
11
|
+
module <%= app_const_base %>
|
12
|
+
class Application < Rails::Application
|
13
|
+
|
14
|
+
config.i18n.default_locale = 'zh-CN'
|
15
|
+
|
16
|
+
config.time_zone = 'Beijing'
|
17
|
+
|
18
|
+
config.encoding = 'utf-8'
|
19
|
+
|
20
|
+
config.filter_parameters += [:password, :password_confirm, :encrypted_password, :token, :private_token]
|
21
|
+
|
22
|
+
config.assets.enabled = true
|
23
|
+
|
24
|
+
config.sass.load_paths << Compass::Frameworks['compass'].stylesheets_directory
|
25
|
+
|
26
|
+
config.assets.compile = true
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
Time.zone = 'Beijing'
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= app_const %>.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = true
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Do not compress assets
|
26
|
+
config.assets.compress = false
|
27
|
+
|
28
|
+
# Expands the lines which load the assets
|
29
|
+
config.assets.debug = true
|
30
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
<%= app_const %>.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Generate digests for assets URLs
|
18
|
+
config.assets.digest = true
|
19
|
+
|
20
|
+
# Defaults to Rails.root.join("public/assets")
|
21
|
+
# config.assets.manifest = YOUR_PATH
|
22
|
+
|
23
|
+
# Specifies the header that your server uses for sending files
|
24
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
25
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
26
|
+
|
27
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
28
|
+
# config.force_ssl = true
|
29
|
+
|
30
|
+
# See everything in the log (default is :info)
|
31
|
+
# config.log_level = :debug
|
32
|
+
|
33
|
+
# Prepend all log lines with the following tags
|
34
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
35
|
+
|
36
|
+
# Use a different logger for distributed setups
|
37
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
38
|
+
|
39
|
+
# Use a different cache store in production
|
40
|
+
# config.cache_store = :mem_cache_store
|
41
|
+
|
42
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
43
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
44
|
+
|
45
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
46
|
+
# config.assets.precompile += %w( search.js )
|
47
|
+
|
48
|
+
# Disable delivery errors, bad email addresses will be ignored
|
49
|
+
# config.action_mailer.raise_delivery_errors = false
|
50
|
+
|
51
|
+
# Enable threaded mode
|
52
|
+
# config.threadsafe!
|
53
|
+
|
54
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
55
|
+
# the I18n.default_locale when a translation can not be found)
|
56
|
+
config.i18n.fallbacks = true
|
57
|
+
|
58
|
+
# Send deprecation notices to registered listeners
|
59
|
+
config.active_support.deprecation = :notify
|
60
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= app_const %>.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
# Show full error reports and disable caching
|
18
|
+
config.consider_all_requests_local = true
|
19
|
+
config.action_controller.perform_caching = false
|
20
|
+
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
22
|
+
config.action_dispatch.show_exceptions = false
|
23
|
+
|
24
|
+
# Disable request forgery protection in test environment
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
26
|
+
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
29
|
+
# ActionMailer::Base.deliveries array.
|
30
|
+
config.action_mailer.delivery_method = :test
|
31
|
+
|
32
|
+
# Print deprecation notices to the stderr
|
33
|
+
config.active_support.deprecation = :stderr
|
34
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
hosts:
|
3
|
+
- 127.0.0.1:27017
|
4
|
+
|
5
|
+
development:
|
6
|
+
sessions:
|
7
|
+
default:
|
8
|
+
<<: *defaults
|
9
|
+
database: <%= app_name %>_dev
|
10
|
+
|
11
|
+
test:
|
12
|
+
sessions:
|
13
|
+
default:
|
14
|
+
<<: *defaults
|
15
|
+
database: <%= app_name %>_test
|
16
|
+
|
17
|
+
production:
|
18
|
+
sessions:
|
19
|
+
default:
|
20
|
+
<<: *defaults
|
21
|
+
database: <%= app_name %>
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: h2ocube_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ben
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.2'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.1'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.1'
|
46
|
+
description: ! ' H2ocube Generator is the base Rails application builder. '
|
47
|
+
email:
|
48
|
+
- ben@h2ocube.com
|
49
|
+
executables:
|
50
|
+
- h2ocube_generator
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- .travis.yml
|
56
|
+
- Gemfile
|
57
|
+
- LICENSE.txt
|
58
|
+
- README.md
|
59
|
+
- Rakefile
|
60
|
+
- bin/h2ocube_generator
|
61
|
+
- h2ocube_generator.gemspec
|
62
|
+
- lib/h2ocube_generator.rb
|
63
|
+
- lib/h2ocube_generator/app_builder.rb
|
64
|
+
- lib/h2ocube_generator/app_generator.rb
|
65
|
+
- source/Gemfile.erb
|
66
|
+
- source/README.md.erb
|
67
|
+
- source/config/application.rb.erb
|
68
|
+
- source/config/environments/development.rb.erb
|
69
|
+
- source/config/environments/production.rb.erb
|
70
|
+
- source/config/environments/test.rb.erb
|
71
|
+
- source/config/mongoid.yml.erb
|
72
|
+
homepage: ''
|
73
|
+
licenses: []
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
hash: 1625306676968380011
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
hash: 1625306676968380011
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 1.8.24
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: H2ocube Generator is the base Rails application builder.
|
102
|
+
test_files: []
|