enginizer 0.0.1
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 +17 -0
- data/.rvmrc +52 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/enginizer +5 -0
- data/enginizer.gemspec +23 -0
- data/lib/core_ext/string.rb +6 -0
- data/lib/enginizer.rb +2 -0
- data/lib/enginizer/app.rb +10 -0
- data/lib/enginizer/cli.rb +15 -0
- data/lib/enginizer/cmd.rb +1 -0
- data/lib/enginizer/extension.rb +82 -0
- data/lib/enginizer/templates/%namespaced_name%/%namespaced_name%.gemspec.tt +28 -0
- data/lib/enginizer/templates/%namespaced_name%/.rspec +5 -0
- data/lib/enginizer/templates/%namespaced_name%/.rvmrc.tt +21 -0
- data/lib/enginizer/templates/%namespaced_name%/Gemfile +20 -0
- data/lib/enginizer/templates/%namespaced_name%/Guardfile +37 -0
- data/lib/enginizer/templates/%namespaced_name%/MIT-LICENSE.tt +20 -0
- data/lib/enginizer/templates/%namespaced_name%/README.md.tt +3 -0
- data/lib/enginizer/templates/%namespaced_name%/Rakefile.tt +32 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/images/%namespace%/admin/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/images/%namespace%/application/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/javascripts/%namespace%/admin/index.js.coffee +1 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/javascripts/%namespace%/application/index.js.coffee +1 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/stylesheets/%namespace%/admin.css.sass +1 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/stylesheets/%namespace%/admin/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/stylesheets/%namespace%/application.css.sass +1 -0
- data/lib/enginizer/templates/%namespaced_name%/app/assets/stylesheets/%namespace%/application/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/controllers/%namespace%/admin/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/controllers/%namespace%/application/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/controllers/%namespace%/application_controller.rb.tt +4 -0
- data/lib/enginizer/templates/%namespaced_name%/app/helpers/%namespace%/admin/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/helpers/%namespace%/application/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/helpers/%namespace%/application_helper.rb.tt +4 -0
- data/lib/enginizer/templates/%namespaced_name%/app/models/%namespace%.rb.tt +5 -0
- data/lib/enginizer/templates/%namespaced_name%/app/models/%namespace%/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/views/%namespace%/admin/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/views/%namespace%/application/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/app/views/layouts/%namespace%/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/config/routes.rb.tt +3 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/%extension_name%.rb.tt +16 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/%extension_name%/configuration.rb.tt +11 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/%extension_name%/engine.rb.tt +36 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/%extension_name%/version.rb.tt +5 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/testing_support/factories.rb +5 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespace%/testing_support/factories/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/%namespaced_name%.rb.tt +1 -0
- data/lib/enginizer/templates/%namespaced_name%/lib/tasks/%namespaced_name%_tasks.rake.tt +4 -0
- data/lib/enginizer/templates/%namespaced_name%/script/rails.tt +8 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/%namespace%/%extension_name%/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/%namespace%/%extension_name%_spec.rb.tt +2 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/README.rdoc +261 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/Rakefile +7 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/assets/images/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/mailers/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/models/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config.ru +4 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/application.rb.tt +65 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/boot.rb +10 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/database.yml +25 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/environment.rb +5 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/environments/development.rb +37 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/environments/production.rb +67 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/environments/test.rb +37 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/inflections.rb +15 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/session_store.rb +8 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/teabag.rb.tt +58 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/locales/en.yml +5 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/config/routes.rb.tt +4 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/db/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/lib/assets/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/log/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/public/404.html +26 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/public/422.html +26 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/public/500.html +25 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/public/favicon.ico +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/script/rails +6 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/dummy/spec/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/factory_spec.rb +7 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/javascripts/fixtures/.empty_directory +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/javascripts/nfinity/admin/.empty_directory +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/javascripts/nfinity/application/.empty_directory +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/javascripts/spec_helper.coffee +1 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/javascripts/support/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/spec_helper.rb.tt +49 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/support/.gitkeep +0 -0
- data/lib/enginizer/templates/%namespaced_name%/spec/teabag_env.rb +17 -0
- data/lib/enginizer/version.rb +5 -0
- metadata +193 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
|
4
|
+
# development environment upon cd'ing into the directory
|
|
5
|
+
|
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
|
7
|
+
# Only full ruby name is supported here, for short names use:
|
|
8
|
+
# echo "rvm use 1.9.3" > .rvmrc
|
|
9
|
+
environment_id="ruby-1.9.3-p194@enginizer"
|
|
10
|
+
|
|
11
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
|
12
|
+
# rvmrc_rvm_version="1.18.18 (stable)" # 1.10.1 seams as a safe start
|
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
|
15
|
+
# return 1
|
|
16
|
+
# }
|
|
17
|
+
|
|
18
|
+
# First we attempt to load the desired environment directly from the environment
|
|
19
|
+
# file. This is very fast and efficient compared to running through the entire
|
|
20
|
+
# CLI and selector. If you want feedback on which environment was used then
|
|
21
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
|
22
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
|
23
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
|
24
|
+
then
|
|
25
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
|
26
|
+
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
|
27
|
+
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
|
28
|
+
if [[ $- == *i* ]] # check for interactive shells
|
|
29
|
+
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
|
|
30
|
+
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
|
|
31
|
+
fi
|
|
32
|
+
else
|
|
33
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
|
34
|
+
rvm --create use "$environment_id" || {
|
|
35
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
|
36
|
+
return 1
|
|
37
|
+
}
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# If you use bundler, this might be useful to you:
|
|
41
|
+
# if [[ -s Gemfile ]] && {
|
|
42
|
+
# ! builtin command -v bundle >/dev/null ||
|
|
43
|
+
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
|
44
|
+
# }
|
|
45
|
+
# then
|
|
46
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
|
47
|
+
# gem install bundler
|
|
48
|
+
# fi
|
|
49
|
+
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
|
50
|
+
# then
|
|
51
|
+
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
|
52
|
+
# fi
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Christopher Hein
|
|
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,29 @@
|
|
|
1
|
+
# Enginizer
|
|
2
|
+
|
|
3
|
+
Generate Namespaces engines for easy modular rails app development.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'enginizer'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install enginizer
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
$ enginizer engine engines/enginizer
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
1. Fork it
|
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/enginizer
ADDED
data/enginizer.gemspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
2
|
+
|
|
3
|
+
# Maintain your gem's version:
|
|
4
|
+
require "enginizer/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "enginizer"
|
|
8
|
+
gem.version = Enginizer::version
|
|
9
|
+
gem.authors = ["Christopher Hein"]
|
|
10
|
+
gem.email = ["me@christopherhein.com"]
|
|
11
|
+
gem.homepage = "http://chrishein.com"
|
|
12
|
+
gem.summary = "Command line tool for building modular rails applications."
|
|
13
|
+
gem.description = "Command line tool for building modular rails applications."
|
|
14
|
+
|
|
15
|
+
gem.files = `git ls-files`.split($/)
|
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
|
+
gem.require_paths = ["lib"]
|
|
19
|
+
|
|
20
|
+
gem.add_dependency "thor"
|
|
21
|
+
gem.add_dependency "rvm"
|
|
22
|
+
gem.add_dependency "rails"
|
|
23
|
+
end
|
data/lib/enginizer.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'thor'
|
|
3
|
+
|
|
4
|
+
require "enginizer/extension"
|
|
5
|
+
require "enginizer/app"
|
|
6
|
+
|
|
7
|
+
module Enginizer
|
|
8
|
+
class Cli < Thor
|
|
9
|
+
include Thor::Actions
|
|
10
|
+
|
|
11
|
+
register Enginizer::Extension, :engine, "engine NAME", "Bootstraps a new engine for development."
|
|
12
|
+
register Enginizer::App, :new, "app NAME", "Bootstraps a new enginized application."
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "enginizer/cli"
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
require "rvm"
|
|
2
|
+
|
|
3
|
+
module Enginizer
|
|
4
|
+
class Extension < Thor::Group
|
|
5
|
+
include Thor::Actions
|
|
6
|
+
|
|
7
|
+
namespace "extension"
|
|
8
|
+
argument :name, type: :string, desc: "name of the engine to create"
|
|
9
|
+
desc "Bootstraps a new engine for development."
|
|
10
|
+
class_options bundler: false, git: false, rvm: true, namespace: "nfinity"
|
|
11
|
+
def configure_dependencies
|
|
12
|
+
extension_path
|
|
13
|
+
extension_name
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Build the extension
|
|
17
|
+
def copy_extension
|
|
18
|
+
directory "%namespaced_name%", extension_path
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def rvm
|
|
22
|
+
if options.rvm?
|
|
23
|
+
ENV["rvm_trust_rvmrcs_flag"]="1"
|
|
24
|
+
RVM.use_from_path! extension_path
|
|
25
|
+
else
|
|
26
|
+
run "rm #{extension_path}/.rvmrc"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def bundler
|
|
31
|
+
if options.bundler?
|
|
32
|
+
run "cd #{extension_path} && bundle install"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def git
|
|
37
|
+
if options.git?
|
|
38
|
+
run "cd #{extension_path} && git init && git add ."
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Scoping for the files
|
|
43
|
+
def self.source_root
|
|
44
|
+
File.expand_path("../templates", __FILE__)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def namespaced_name
|
|
48
|
+
@namespaced_name
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def namespace
|
|
52
|
+
options.namespace
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def extension_name
|
|
56
|
+
@extension_name ||= @namespaced_name.gsub("#{options.namespace}_", "")
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def author
|
|
60
|
+
`git config user.name`.chomp
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def email
|
|
64
|
+
`git config user.email`.chomp
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
private
|
|
68
|
+
|
|
69
|
+
def extension_path
|
|
70
|
+
path = name.split("/")
|
|
71
|
+
module_name = namespace_name(path.pop)
|
|
72
|
+
path.push(module_name)
|
|
73
|
+
@extension_path ||= path.join("/")
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def namespace_name name
|
|
77
|
+
return name if (name =~ /#{options.namespace}_/) == 0
|
|
78
|
+
@namespaced_name ||= "#{options.namespace}_#{name}"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
2
|
+
|
|
3
|
+
# Maintain your gem's version:
|
|
4
|
+
require "<%= namespace %>/<%= extension_name %>/version"
|
|
5
|
+
|
|
6
|
+
# Describe your gem and declare its dependencies:
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = "<%= @namespaced_name %>"
|
|
9
|
+
s.version = <%= namespace.camel_case %>::version
|
|
10
|
+
s.authors = ["<%= author %>"]
|
|
11
|
+
s.email = ["<%= email %>"]
|
|
12
|
+
s.homepage = "TODO: Homepage for self promotion"
|
|
13
|
+
s.summary = "TODO: Summary of your engine"
|
|
14
|
+
s.description = "TODO: Description of your engine"
|
|
15
|
+
|
|
16
|
+
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
|
|
17
|
+
|
|
18
|
+
s.add_dependency "rails", "~> 3.2.11"
|
|
19
|
+
s.add_dependency "coffee-script"
|
|
20
|
+
s.add_dependency "sass-rails"
|
|
21
|
+
# s.add_dependency "haml-rails"
|
|
22
|
+
# s.add_dependency "jquery-rails"
|
|
23
|
+
# s.add_dependency "angularjs-rails"
|
|
24
|
+
# s.add_dependency "ace-rails-ap"
|
|
25
|
+
# s.add_dependency "bourbon"
|
|
26
|
+
|
|
27
|
+
s.add_development_dependency "sqlite3"
|
|
28
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
environment_id="ruby-1.9.3-p194@<%= @namespaced_name %>"
|
|
4
|
+
|
|
5
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
|
6
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
|
7
|
+
then
|
|
8
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
|
9
|
+
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
|
10
|
+
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
|
11
|
+
if [[ $- == *i* ]] # check for interactive shells
|
|
12
|
+
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
|
|
13
|
+
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
|
|
14
|
+
fi
|
|
15
|
+
else
|
|
16
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
|
17
|
+
rvm --create use "$environment_id" || {
|
|
18
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
|
19
|
+
return 1
|
|
20
|
+
}
|
|
21
|
+
fi
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
source :rubygems
|
|
2
|
+
|
|
3
|
+
gemspec
|
|
4
|
+
|
|
5
|
+
gem "factory_girl_rails", "3.5.0", :require => false
|
|
6
|
+
gem "rspec-rails"
|
|
7
|
+
gem "shoulda-matchers"
|
|
8
|
+
gem "faker"
|
|
9
|
+
gem "debugger"
|
|
10
|
+
gem "spork"
|
|
11
|
+
|
|
12
|
+
gem "teabag"
|
|
13
|
+
|
|
14
|
+
gem "guard"
|
|
15
|
+
gem "guard-rspec"
|
|
16
|
+
gem "guard-spork"
|
|
17
|
+
gem "guard-bundler"
|
|
18
|
+
gem "guard-teabag"
|
|
19
|
+
gem "rb-fsevent"
|
|
20
|
+
gem "terminal-notifier-guard"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
guard 'bundler' do
|
|
2
|
+
watch('Gemfile')
|
|
3
|
+
watch('*.gemspec')
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
guard 'spork', bundler: true, rspec_env: { 'RAILS_ENV' => 'test' }, wait: 200 do
|
|
7
|
+
watch('config/application.rb')
|
|
8
|
+
watch('config/environment.rb')
|
|
9
|
+
watch('config/environments/test.rb')
|
|
10
|
+
watch(%r{^config/initializers/.+\.rb$})
|
|
11
|
+
watch('Gemfile')
|
|
12
|
+
watch('Gemfile.lock')
|
|
13
|
+
watch('spec/spec_helper.rb') { :rspec }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
guard 'rspec', cli: "--drb", all_on_start: false, all_after_pass: false do
|
|
17
|
+
watch(%r{^spec/.+_spec\.rb$})
|
|
18
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
|
19
|
+
watch('spec/spec_helper.rb') { "spec" }
|
|
20
|
+
|
|
21
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
22
|
+
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
|
23
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
|
24
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
|
25
|
+
watch('config/routes.rb') { "spec/routing" }
|
|
26
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
|
27
|
+
|
|
28
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
|
29
|
+
|
|
30
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
|
31
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
guard :teabag, environment: "spec/teabag_env.rb", all_on_start: false, all_after_pass: false do
|
|
35
|
+
watch(%r{app/assets/javascripts/(.+).coffee}) { |m| "#{m[1]}_spec" }
|
|
36
|
+
watch(%r{spec/javascripts/(.*)})
|
|
37
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2013 <%= author %>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
begin
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
rescue LoadError
|
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
|
+
end
|
|
7
|
+
begin
|
|
8
|
+
require 'rdoc/task'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
require 'rdoc/rdoc'
|
|
11
|
+
require 'rake/rdoctask'
|
|
12
|
+
RDoc::Task = Rake::RDocTask
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
17
|
+
rdoc.title = '<%= namespace.camel_case %>::<%= extension_name.capitalize %>'
|
|
18
|
+
rdoc.options << '--line-numbers'
|
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
25
|
+
|
|
26
|
+
load 'rails/tasks/engine.rake'
|
|
27
|
+
require 'rspec/core/rake_task'
|
|
28
|
+
|
|
29
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
30
|
+
task default: :spec
|
|
31
|
+
|
|
32
|
+
Bundler::GemHelper.install_tasks
|