turbo 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +58 -0
  5. data/Rakefile +2 -0
  6. data/bin/turbo +6 -0
  7. data/lib/turbo.rb +21 -0
  8. data/lib/turbo/application.rb +34 -0
  9. data/lib/turbo/generator.rb +133 -0
  10. data/lib/turbo/templates/dummy/database.yml +3 -0
  11. data/lib/turbo/templates/dummy/routes.rb +3 -0
  12. data/lib/turbo/templates/dummy/schema.rb +3 -0
  13. data/lib/turbo/templates/gitignore +21 -0
  14. data/lib/turbo/templates/root/%underscored%.gemspec.tt +30 -0
  15. data/lib/turbo/templates/root/Gemfile.tt +16 -0
  16. data/lib/turbo/templates/root/MIT-LICENSE.tt +20 -0
  17. data/lib/turbo/templates/root/README.md.tt +23 -0
  18. data/lib/turbo/templates/root/Rakefile.tt +36 -0
  19. data/lib/turbo/templates/root/config.ru.tt +7 -0
  20. data/lib/turbo/templates/root/lib/%underscored%.rb.tt +5 -0
  21. data/lib/turbo/templates/root/lib/%underscored%/engine.rb.tt +5 -0
  22. data/lib/turbo/templates/root/lib/%underscored%/version.rb.tt +3 -0
  23. data/lib/turbo/templates/spec/%underscored%_spec.rb.tt +7 -0
  24. data/lib/turbo/templates/spec/integration/navigation_spec.rb.tt +9 -0
  25. data/lib/turbo/templates/spec/spec_helper.rb.tt +33 -0
  26. data/lib/turbo/templates/spec/support/sample.rb.tt +1 -0
  27. data/lib/turbo/templates/test/%underscored%_test.rb.tt +7 -0
  28. data/lib/turbo/templates/test/integration/navigation_test.rb.tt +7 -0
  29. data/lib/turbo/templates/test/support/integration_case.rb.tt +5 -0
  30. data/lib/turbo/templates/test/test_helper.rb.tt +25 -0
  31. data/lib/turbo/version.rb +8 -0
  32. data/turbo.gemspec +22 -0
  33. metadata +144 -0
data/.gitignore ADDED
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in turbo.gemspec
4
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 Steven Hancock (stevenh512@gmail.com)
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.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # Turbo
2
+
3
+ **WARNING: At this point, this is entirely untested and may contain tons of
4
+ bugs. Consider this alpha code at best, use it if it works for you but don't
5
+ say I didn't warn you.** :)
6
+
7
+ Rails Engine generator inspired by [EngineX], [Combustion] and [Bundler]'s Gem
8
+ generator. I've tried to take the best of both generators, combined with an
9
+ embedded dummy app for testing similar to [Combustion]'s.
10
+
11
+ Generated Engines should be compatible with Rails 3.0 or 3.1, but again it's
12
+ untested.
13
+
14
+ ## Installation
15
+
16
+ Install the turbo gem in the usual ways:
17
+
18
+ Rubygems:
19
+ gem install turbo
20
+
21
+ Github:
22
+ git clone git://github.com/stevenh512/turbo.git
23
+ cd turbo
24
+ bundle install
25
+ rake install
26
+
27
+ Bundler:
28
+ gem 'turbo' #, :git => git://github.com/stevenh512/turbo.git
29
+
30
+ ## Usage
31
+
32
+ Generate a ready-to-run Rails 3 engine.
33
+
34
+ $ turbo engine_name [--test-framework=TEST_FRAMEWORK]
35
+
36
+ `TEST_FRAMEWORK` is optional and can be either `rspec` or `test_unit`. It
37
+ defaults to `test_unit`.
38
+
39
+ If you installed with Bundler you may need to use `bundle exec`.
40
+
41
+ ## Note on tests
42
+
43
+ I haven't written any tests for this code, honestly I don't know how I'd test
44
+ most of it. If you figure it out and would like to contribute any tests, feel
45
+ free, I'd appreciate it. I prefer RSpec but I can work with Test::Unit too. :)
46
+
47
+ ## Note on Patches/Pull Requests
48
+
49
+ * Fork the project.
50
+ * Make your feature addition or bug fix.
51
+ * Commit, do not mess with Rakefile, version, or history. (if you want to have
52
+ your own version, that is fine but bump version in a commit by itself I can
53
+ ignore when I pull)
54
+ * Send me a pull request. Bonus points for topic branches.
55
+
56
+ ## Copyright
57
+
58
+ Copyright (c) <%= Date.today.year %> <%= author %>. See MIT-LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/turbo ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require 'turbo/generator'
3
+
4
+ ARGV << "--help" if ARGV.empty?
5
+
6
+ Turbo::Generator.start
data/lib/turbo.rb ADDED
@@ -0,0 +1,21 @@
1
+ require 'rails'
2
+ require 'active_support/dependencies'
3
+ require 'turbo/version'
4
+
5
+ module Turbo
6
+ autoload :Application, 'turbo/application'
7
+ Modules = %w( active_record action_controller action_view action_mailer )
8
+
9
+ def self.initialize!(*modules)
10
+ Modules << 'sprockets' if Rails.version.to_f >= 3.1
11
+ modules = Modules if modules.empty? || modules == [:all]
12
+ modules.each { |mod| require "#{mod}/railtie" }
13
+
14
+ Turbo::Application.configure_for_turbo
15
+ Turbo::Application.initialize!
16
+
17
+ silence_stream(STDOUT) do
18
+ load "#{Rails.root}/db/schema.rb"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,34 @@
1
+ Rails.env = 'test'
2
+
3
+ class Turbo::Application < Rails::Application
4
+ config.root = File.expand_path File.join(Dir.pwd, defined?(RSpec) ? 'spec' : 'test', 'internal')
5
+
6
+ # Core Settings
7
+ config.cache_classes = true
8
+ config.whiny_nils = true
9
+ config.consider_all_requests_local = true
10
+ config.secret_token = Digest::SHA1.hexdigest Time.now.to_s
11
+
12
+ # ActiveSupport Settings
13
+ config.active_support.deprecation = :stderr
14
+
15
+ # Some settings we're not sure if we want, so let's not laod them by default.
16
+ # Instead, wait for this method to be invoked (to get around load-order
17
+ # complications).
18
+ def self.configure_for_turbo
19
+ if defined?(ActionController) && defined?(ActionController::Engine)
20
+ config.action_dispatch.show_exceptions = false
21
+ config.action_controller.perform_caching = false
22
+ config.action_controller.allow_forgery_protection = false
23
+ end
24
+
25
+ if defined?(ActionMailer) && defined?(ActionMailer::Engine)
26
+ config.action_mailer.delivery_method = :test
27
+ config.action_mailer.default_url_options = { :host => 'www.example.com' }
28
+ end
29
+
30
+ if defined?(Sprockets)
31
+ config.assets.enabled = true
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,133 @@
1
+ require "turbo/version"
2
+ require "thor/group"
3
+ require "active_support"
4
+ require "active_support/version"
5
+ require "active_support/core_ext/string"
6
+
7
+ module Turbo
8
+ class Generator < Thor::Group
9
+ include Thor::Actions
10
+ check_unknown_options!
11
+
12
+ def self.source_root
13
+ @_source_root ||= File.expand_path('../templates', __FILE__)
14
+ end
15
+
16
+ def self.say_step(message)
17
+ @step = (@step || 0) + 1
18
+ class_eval <<-METHOD, __FILE__, __LINE__ + 1
19
+ def step_#{@step}
20
+ #{"puts" if @step > 1}
21
+ say_status "STEP #{@step}", #{message.inspect}
22
+ end
23
+ METHOD
24
+ end
25
+
26
+ argument :path, :type => :string,
27
+ :desc => "Path of the engine to be created"
28
+
29
+ class_option :test_framework, :default => "test_unit", :aliases => "-t",
30
+ :desc => "Test framework to use, test_unit or rspec."
31
+
32
+ desc "Creates a Rails 3 engine with Rakefile, Gemfile and running tests."
33
+
34
+ say_step "Creating gem skeleton"
35
+
36
+ def create_root
37
+ self.destination_root = File.expand_path(path, destination_root)
38
+ set_accessors!
39
+
40
+ directory "root", "."
41
+ FileUtils.cd(destination_root)
42
+ end
43
+
44
+ def create_gitignore
45
+ template "gitignore", ".gitignore"
46
+ end
47
+
48
+ def create_tests_or_specs
49
+ directory test_path
50
+ empty_directory dummy_path
51
+ empty_directory File.join(dummy_path, 'config')
52
+ empty_directory File.join(dummy_path, 'db')
53
+ empty_directory File.join(dummy_path, 'log')
54
+ empty_directory File.join(dummy_path, 'public')
55
+ template 'dummy/routes.rb', File.join(dummy_path, 'config', 'routes.rb')
56
+ template 'dummy/database.yml', File.join(dummy_path, 'config', 'database.yml')
57
+ template 'dummy/schema.rb', File.join(dummy_path, 'db', 'schema.rb')
58
+ create_file File.join(dummy_path, 'public', 'favicon.ico')
59
+ create_file File.join(dummy_path, 'log', '.gitignore') do
60
+ '*.log'
61
+ end
62
+ end
63
+
64
+ def initialize_git_repo
65
+ run 'git init'
66
+ run 'git add .'
67
+ run 'git commit -am "initial commit"'
68
+ end
69
+
70
+ protected
71
+ def rspec?
72
+ @_rspec ||= options[:test_framework] == "rspec"
73
+ end
74
+
75
+ def test_unit?
76
+ @_test_unit ||= options[:test_framework] == "test_unit"
77
+ end
78
+
79
+ def test_path
80
+ @_test_path ||= rspec? ? "spec" : "test"
81
+ end
82
+
83
+ def dummy_path
84
+ @_dummy_path ||= File.join(test_path, 'internal')
85
+ end
86
+
87
+ def self.banner
88
+ self_task.formatted_usage(self, false)
89
+ end
90
+
91
+ def application_definition
92
+ @application_definition ||= begin
93
+ contents = File.read(File.expand_path("#{dummy_path}/config/application.rb", destination_root))
94
+ contents[(contents.index("module Dummy"))..-1]
95
+ end
96
+ end
97
+ alias :store_application_definition! :application_definition
98
+
99
+ # Cache accessors since we are changing the directory
100
+ def set_accessors!
101
+ self.name
102
+ self.class.source_root
103
+ end
104
+
105
+ def name
106
+ @name ||= File.basename(destination_root)
107
+ end
108
+
109
+ def camelized
110
+ @camelized ||= name.camelize
111
+ end
112
+
113
+ def underscored
114
+ @underscored ||= name.underscore
115
+ end
116
+
117
+ def git_user_name
118
+ @git_user_name ||= `git config user.name`.chomp
119
+ end
120
+
121
+ def git_user_email
122
+ @git_user_email ||= `git config user.email`.chomp
123
+ end
124
+
125
+ def author
126
+ @author ||= git_user_name.empty? ? "TODO: Write your name" : git_user_name
127
+ end
128
+
129
+ def email
130
+ @email ||= git_user_email.empty? ? "TODO: Write your email address" : git_user_email
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,3 @@
1
+ test:
2
+ adapter: <%= "jdbc" if defined? JRUBY_VERSION %>sqlite3
3
+ database: db/turbo_test.sqlite
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ #
3
+ end
@@ -0,0 +1,3 @@
1
+ ActiveRecord::Schema.define do
2
+ #
3
+ end
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ _yardoc
7
+ coverage
8
+ doc/
9
+ Gemfile.lock
10
+ InstalledFiles
11
+ lib/bundler/man
12
+ log/*.log
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ <%= dummy_path %>/db/*.sqlite3
20
+ <%= dummy_path %>/log/*.log
21
+ <%= dummy_path %>/tmp/
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/<%= underscored %>/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "<%= underscored %>"
6
+ gem.version = <%= camelized %>::VERSION
7
+ gem.authors = ["<%= author %>"]
8
+ gem.email = ["<%= email %>"]
9
+ gem.homepage = "TODO: Write homepage url"
10
+ gem.summary = "TODO: Write a gem summary"
11
+ gem.description = "TODO: Write a gem description"
12
+
13
+ gem.files = `git ls-files`.split("\n")
14
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.add_runtime_dependency "railties", "~> <%= Turbo::RAILS_VERSION %>"
19
+ gem.add_runtime_dependency "thor", "~> 0.14.0"
20
+
21
+ gem.add_development_dependency "turbo", "~> <%= Turbo::VERSION %>"
22
+ gem.add_development_dependency "rdoc", "~> 3.9.4"
23
+ gem.add_development_dependency "rails", "~> <%= Turbo::RAILS_VERSION %>"
24
+ gem.add_development_dependency "sqlite3"
25
+ gem.add_development_dependency "jquery-rails"
26
+ gem.add_development_dependency "capybara", "~> <%= Turbo::CAPYBARA_VERSION %>"
27
+ <%- if rspec? -%>
28
+ gem.add_development_dependency "rspec-rails", "~> <%= Turbo::RSPEC_VERSION %>"
29
+ <%- end -%>
30
+ end
@@ -0,0 +1,16 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ # Load Turbo from git
6
+ # gem 'turbo', :git => 'git://github.com/stevenh512/turbo.git'
7
+
8
+ # Load ruby-debug for your platform
9
+ # gem 'ruby-debug', :require => 'ruby-debug', :platform => :mri_18
10
+ # gem 'ruby-debug19', :require => 'ruby-debug', :platform => :mri_19
11
+ <%- if test_unit? -%>
12
+
13
+ # Load ANSI and Turn for better looking Test::Unit reports.
14
+ # gem 'ansi', '~> <%= Turbo::ANSI_VERSION %>'
15
+ # gem 'turn', '~> <%= Turbo::TURN_VERSION %>'
16
+ <%- end -%>
@@ -0,0 +1,20 @@
1
+ Copyright <%= Date.today.year %> <%= author %> (<%= email %>)
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,23 @@
1
+ # <%= camelized %>
2
+
3
+ TODO: Describe your gem
4
+
5
+ ## Installation
6
+
7
+ Gemfile:
8
+ gem '<%= underscored %>'
9
+
10
+ ## Note on Patches/Pull Requests
11
+
12
+ * Fork the project.
13
+ * Make your feature addition or bug fix.
14
+ * Add tests for it. This is important so I don't break it in a future version
15
+ unintentionally.
16
+ * Commit, do not mess with Rakefile, version, or history. (if you want to have
17
+ your own version, that is fine but bump version in a commit by itself I can
18
+ ignore when I pull)
19
+ * Send me a pull request. Bonus points for topic branches.
20
+
21
+ ## Copyright
22
+
23
+ Copyright (c) <%= Date.today.year %> <%= author %>. See MIT-LICENSE for details.
@@ -0,0 +1,36 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rake'
10
+ require 'rdoc/task'
11
+
12
+ <% if rspec? -%>
13
+ require 'rspec/core'
14
+ require 'rspec/core/rake_task'
15
+
16
+ RSpec::Core::RakeTask.new(:spec)
17
+ <% else -%>
18
+ require 'rake/testtask'
19
+
20
+ Rake::TestTask.new(:test) do |t|
21
+ t.libs << 'lib'
22
+ t.libs << 'test'
23
+ t.pattern = 'test/**/*_test.rb'
24
+ t.verbose = false
25
+ end
26
+ <% end -%>
27
+
28
+ task :default => :<%= test_path %>
29
+
30
+ Rake::RDocTask.new(:rdoc) do |rdoc|
31
+ rdoc.rdoc_dir = 'rdoc'
32
+ rdoc.title = '<%= camelized %>'
33
+ rdoc.options << '--line-numbers' << '--inline-source'
34
+ rdoc.rdoc_files.include('README.rdoc')
35
+ rdoc.rdoc_files.include('lib/**/*.rb')
36
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require :default, :development
5
+
6
+ Turbo.initialize!
7
+ run Turbo::Application
@@ -0,0 +1,5 @@
1
+ require '<%= underscored %>/version'
2
+ require '<%= underscored %>/engine'
3
+
4
+ module <%= camelized %>
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'rails'
2
+ module <%= camelized %>
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module <%= camelized %>
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= camelized %> do
4
+ it "should be valid" do
5
+ <%= camelized %>.should be_a(Module)
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Navigation" do
4
+ include Capybara::DSL
5
+
6
+ it "should be a valid app" do
7
+ ::Rails.application.should be_a(Turbo::Application)
8
+ end
9
+ end
@@ -0,0 +1,33 @@
1
+ # Configure Rails environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require 'rubygems'
5
+ require 'bundler'
6
+
7
+ Bundler.require :default, :development
8
+
9
+ require 'turbo'
10
+ require 'capybara/rspec'
11
+
12
+ Turbo.initialize!
13
+
14
+ require 'rails/test_help'
15
+ require 'rspec/rails'
16
+
17
+ ActionMailer::Base.delivery_method = :test
18
+ ActionMailer::Base.perform_deliveries = true
19
+ Rails.backtrace_cleaner.remove_silencers!
20
+
21
+ require 'capybara/rails'
22
+ Capybara.default_driver = :rack_test
23
+ Capybara.default_selector = :css
24
+
25
+ # Load support files
26
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
27
+
28
+ RSpec.configure do |config|
29
+ require 'rspec/expectations'
30
+ config.include Rspec::Matchers
31
+ config.mock_with :rspec
32
+ config.use_transactional_fixtures = true
33
+ end
@@ -0,0 +1 @@
1
+ # Anything in spec/support will be loaded automatically by spec_helper.rb
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class <%= camelized %>Test < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, <%= camelized %>
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActiveSupport::IntegrationCase
4
+ test "truth" do
5
+ assert_kind_of Turbo::Application, Rails.application
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # Define a bare test case to use with Capybara
2
+ class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
3
+ include Capybara::DSL
4
+ include Rails.application.routes.url_helpers
5
+ end
@@ -0,0 +1,25 @@
1
+ # Load Turn if it's available
2
+ begin; require 'turn'; rescue LoadError; end
3
+
4
+ # Configure Rails environment
5
+ ENV["RAILS_ENV"] = "test"
6
+
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ Bundler.require :default, :development
11
+ require 'turbo'
12
+
13
+ Turbo.initialize!
14
+
15
+ ActionMailer::Base.delivery_method = :test
16
+ ActionMailer::Base.perform_deliveries = true
17
+ Rails.backtrace_cleaner.remove_silencers!
18
+
19
+ # Configure capybara for integration testing
20
+ require "capybara/rails"
21
+ Capybara.default_driver = :rack_test
22
+ Capybara.default_selector = :css
23
+
24
+ # Load support files
25
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,8 @@
1
+ module Turbo
2
+ VERSION = "0.0.1"
3
+ ANSI_VERSION = "1.3.0"
4
+ CAPYBARA_VERSION = "1.1.1"
5
+ RAILS_VERSION = "3.0"
6
+ RSPEC_VERSION = "2.6.0"
7
+ TURN_VERSION = "0.8.2"
8
+ end
data/turbo.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/turbo/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "turbo"
6
+ gem.version = Turbo::VERSION
7
+ gem.authors = ["Steven Hancock"]
8
+ gem.email = ["stevenh512@gmail.com"]
9
+ gem.homepage = "https://github.com/stevenh512/turbo"
10
+ gem.summary = "Turbocharged Rails Engine Generator"
11
+ gem.description = "Generate Rails Engines with a minimal embedded dummy app for testing, compatible with Test::Unit and RSpec."
12
+
13
+ gem.files = `git ls-files`.split("\n")
14
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
+ gem.require_paths = ["lib"]
17
+
18
+ gem.add_runtime_dependency "railties", "~> #{Turbo::RAILS_VERSION}"
19
+ gem.add_runtime_dependency "thor", "~> 0.14.0"
20
+
21
+ gem.add_development_dependency "rails", "~> #{Turbo::RAILS_VERSION}"
22
+ end
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: turbo
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Steven Hancock
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-10-04 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: railties
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 3
32
+ - 0
33
+ version: "3.0"
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: thor
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 39
45
+ segments:
46
+ - 0
47
+ - 14
48
+ - 0
49
+ version: 0.14.0
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: rails
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 3
63
+ - 0
64
+ version: "3.0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ description: Generate Rails Engines with a minimal embedded dummy app for testing, compatible with Test::Unit and RSpec.
68
+ email:
69
+ - stevenh512@gmail.com
70
+ executables:
71
+ - turbo
72
+ extensions: []
73
+
74
+ extra_rdoc_files: []
75
+
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - MIT-LICENSE
80
+ - README.md
81
+ - Rakefile
82
+ - bin/turbo
83
+ - lib/turbo.rb
84
+ - lib/turbo/application.rb
85
+ - lib/turbo/generator.rb
86
+ - lib/turbo/templates/dummy/database.yml
87
+ - lib/turbo/templates/dummy/routes.rb
88
+ - lib/turbo/templates/dummy/schema.rb
89
+ - lib/turbo/templates/gitignore
90
+ - lib/turbo/templates/root/%underscored%.gemspec.tt
91
+ - lib/turbo/templates/root/Gemfile.tt
92
+ - lib/turbo/templates/root/MIT-LICENSE.tt
93
+ - lib/turbo/templates/root/README.md.tt
94
+ - lib/turbo/templates/root/Rakefile.tt
95
+ - lib/turbo/templates/root/config.ru.tt
96
+ - lib/turbo/templates/root/lib/%underscored%.rb.tt
97
+ - lib/turbo/templates/root/lib/%underscored%/engine.rb.tt
98
+ - lib/turbo/templates/root/lib/%underscored%/version.rb.tt
99
+ - lib/turbo/templates/spec/%underscored%_spec.rb.tt
100
+ - lib/turbo/templates/spec/integration/navigation_spec.rb.tt
101
+ - lib/turbo/templates/spec/spec_helper.rb.tt
102
+ - lib/turbo/templates/spec/support/sample.rb.tt
103
+ - lib/turbo/templates/test/%underscored%_test.rb.tt
104
+ - lib/turbo/templates/test/integration/navigation_test.rb.tt
105
+ - lib/turbo/templates/test/support/integration_case.rb.tt
106
+ - lib/turbo/templates/test/test_helper.rb.tt
107
+ - lib/turbo/version.rb
108
+ - turbo.gemspec
109
+ has_rdoc: true
110
+ homepage: https://github.com/stevenh512/turbo
111
+ licenses: []
112
+
113
+ post_install_message:
114
+ rdoc_options: []
115
+
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ hash: 3
124
+ segments:
125
+ - 0
126
+ version: "0"
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 3
133
+ segments:
134
+ - 0
135
+ version: "0"
136
+ requirements: []
137
+
138
+ rubyforge_project:
139
+ rubygems_version: 1.5.2
140
+ signing_key:
141
+ specification_version: 3
142
+ summary: Turbocharged Rails Engine Generator
143
+ test_files: []
144
+