trusty-cms 3.8.2 → 3.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +1 -1
- data/app/helpers/scoped_helper.rb +1 -1
- data/app/models/trusty_cms/config.rb +2 -5
- data/config/application.rb +4 -4
- data/config/initializers/devise.rb +1 -1
- data/db/migrate/{001_create_radiant_tables.rb → 001_create_trusty_tables.rb} +1 -1
- data/db/migrate/20111016150725_extend_page_part_content_limit.rb +0 -2
- data/lib/configuration_extensions/configuration_extensions.rb +9 -9
- data/lib/tasks/extensions.rake +4 -4
- data/lib/tasks/framework.rake +28 -28
- data/lib/tasks/radiant_config.rake +4 -4
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/config/definition.rb +1 -1
- data/lib/trusty_cms/extension_loader.rb +1 -1
- data/lib/trusty_cms/extension_path.rb +1 -1
- data/lib/trusty_cms/initializer.rb +14 -14
- data/lib/trusty_cms/taggable.rb +1 -1
- data/lib/trusty_cms/task_support.rb +2 -2
- data/spec/dummy/config/application.rb +8 -8
- data/vendor/extensions/clipped-extension/lib/tasks/clipped_extension_tasks.rake +2 -2
- data/vendor/extensions/multi-site-extension/lib/tasks/scoped_admin_extension_tasks.rake +2 -2
- metadata +3 -103
- data/CONTRIBUTORS.md +0 -279
- data/Vagrantfile +0 -122
- data/app/mailers/password_mailer.rb +0 -10
- data/bin/ci/before_script +0 -10
- data/bin/trusty_test +0 -3
- data/lib/generators/extension/USAGE +0 -30
- data/lib/generators/extension/extension_generator.rb +0 -97
- data/lib/generators/extension/templates/README.md +0 -6
- data/lib/generators/extension/templates/RSpecRakefile +0 -109
- data/lib/generators/extension/templates/Rakefile +0 -25
- data/lib/generators/extension/templates/cucumber.yml +0 -1
- data/lib/generators/extension/templates/cucumber_env.rb +0 -11
- data/lib/generators/extension/templates/cucumber_paths.rb +0 -22
- data/lib/generators/extension/templates/en.yml +0 -3
- data/lib/generators/extension/templates/extension.rb +0 -21
- data/lib/generators/extension/templates/functional_test.rb +0 -15
- data/lib/generators/extension/templates/gemspec.rb +0 -29
- data/lib/generators/extension/templates/lib.rb +0 -8
- data/lib/generators/extension/templates/migration.rb +0 -9
- data/lib/generators/extension/templates/radiant_config.rb +0 -3
- data/lib/generators/extension/templates/routes.rb +0 -5
- data/lib/generators/extension/templates/spec.opts +0 -6
- data/lib/generators/extension/templates/spec_helper.rb +0 -42
- data/lib/generators/extension/templates/tasks.rake +0 -47
- data/lib/generators/extension/templates/test_helper.rb +0 -26
- data/lib/generators/extension_controller/USAGE +0 -36
- data/lib/generators/extension_controller/extension_controller_generator.rb +0 -84
- data/lib/generators/extension_controller/templates/controller.rb +0 -10
- data/lib/generators/extension_controller/templates/controller_spec.rb +0 -23
- data/lib/generators/extension_controller/templates/functional_test.rb +0 -11
- data/lib/generators/extension_controller/templates/helper.rb +0 -2
- data/lib/generators/extension_controller/templates/helper_spec.rb +0 -11
- data/lib/generators/extension_controller/templates/helper_test.rb +0 -4
- data/lib/generators/extension_controller/templates/view.html.erb +0 -2
- data/lib/generators/extension_controller/templates/view_spec.rb +0 -12
- data/lib/generators/extension_mailer/USAGE +0 -17
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +0 -68
- data/lib/generators/extension_mailer/templates/fixture.erb +0 -3
- data/lib/generators/extension_mailer/templates/mailer.rb +0 -15
- data/lib/generators/extension_mailer/templates/unit_test.rb +0 -21
- data/lib/generators/extension_mailer/templates/view.erb +0 -3
- data/lib/generators/extension_migration/USAGE +0 -34
- data/lib/generators/extension_migration/extension_migration_generator.rb +0 -25
- data/lib/generators/extension_migration/templates/migration.rb +0 -11
- data/lib/generators/extension_model/USAGE +0 -35
- data/lib/generators/extension_model/extension_model_generator.rb +0 -68
- data/lib/generators/extension_model/templates/fixtures.yml +0 -19
- data/lib/generators/extension_model/templates/migration.rb +0 -16
- data/lib/generators/extension_model/templates/model.rb +0 -2
- data/lib/generators/extension_model/templates/model_spec.rb +0 -11
- data/lib/generators/extension_model/templates/unit_test.rb +0 -8
- data/lib/generators/generator_base_extension.rb +0 -18
- data/lib/generators/instance/instance_generator.rb +0 -148
- data/lib/generators/instance/templates/databases/db2.yml +0 -40
- data/lib/generators/instance/templates/databases/mysql.yml +0 -47
- data/lib/generators/instance/templates/databases/postgresql.yml +0 -44
- data/lib/generators/instance/templates/databases/sqlite3.yml +0 -16
- data/lib/generators/instance/templates/databases/sqlserver.yml +0 -21
- data/lib/generators/instance/templates/instance_boot.rb +0 -122
- data/lib/generators/instance/templates/instance_config.ru +0 -2
- data/lib/generators/instance/templates/instance_environment.rb +0 -93
- data/lib/generators/instance/templates/instance_gemfile +0 -78
- data/lib/generators/instance/templates/instance_generate +0 -6
- data/lib/generators/instance/templates/instance_radiant_config.rb +0 -16
- data/lib/generators/instance/templates/instance_rakefile +0 -3
- data/lib/generators/instance/templates/instance_routes.rb +0 -1
- data/lib/generators/language_extension/USAGE +0 -27
- data/lib/generators/language_extension/language_extension_generator.rb +0 -71
- data/lib/generators/language_extension/templates/README +0 -3
- data/lib/generators/language_extension/templates/RSpecRakefile +0 -123
- data/lib/generators/language_extension/templates/Rakefile +0 -25
- data/lib/generators/language_extension/templates/available_tags.yml +0 -553
- data/lib/generators/language_extension/templates/cucumber.yml +0 -1
- data/lib/generators/language_extension/templates/cucumber_env.rb +0 -16
- data/lib/generators/language_extension/templates/cucumber_paths.rb +0 -14
- data/lib/generators/language_extension/templates/extension.rb +0 -12
- data/lib/generators/language_extension/templates/functional_test.rb +0 -15
- data/lib/generators/language_extension/templates/gemspec.rb +0 -24
- data/lib/generators/language_extension/templates/lang.yml +0 -181
- data/lib/generators/language_extension/templates/lib.rb +0 -8
- data/lib/generators/language_extension/templates/spec.opts +0 -6
- data/lib/generators/language_extension/templates/spec_helper.rb +0 -36
- data/lib/generators/language_extension/templates/tasks.rake +0 -28
- data/lib/generators/language_extension/templates/test_helper.rb +0 -26
- data/lib/generators/trusty_cms/USAGE +0 -8
- data/lib/generators/trusty_cms/templates/Rakefile.erb +0 -7
- data/lib/generators/trusty_cms/templates/application.rb.erb +0 -149
- data/lib/generators/trusty_cms/templates/boot.rb.erb +0 -9
- data/lib/generators/trusty_cms/templates/config.ru.erb +0 -4
- data/lib/generators/trusty_cms/templates/database.yml.erb +0 -28
- data/lib/generators/trusty_cms/templates/environment.rb.erb +0 -5
- data/lib/generators/trusty_cms/templates/environments/development.rb.erb +0 -24
- data/lib/generators/trusty_cms/templates/environments/production.rb.erb +0 -26
- data/lib/generators/trusty_cms/templates/environments/test.rb.erb +0 -35
- data/lib/generators/trusty_cms/templates/initializers/secret_token.rb.erb +0 -13
- data/lib/generators/trusty_cms/templates/initializers/session_store.rb.erb +0 -8
- data/lib/generators/trusty_cms/templates/initializers/trusty_cms_config.rb.erb +0 -16
- data/lib/generators/trusty_cms/templates/preinitializer.rb.erb +0 -18
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -0
- data/lib/generators/trusty_cms/trusty_cms_generator.rb +0 -32
@@ -1,21 +0,0 @@
|
|
1
|
-
# Uncomment this if you reference any of your controllers in activate
|
2
|
-
# require_dependency "application_controller"
|
3
|
-
require "radiant-<%= file_name %>-extension"
|
4
|
-
|
5
|
-
class <%= class_name %> < TrustyCms::Extension
|
6
|
-
version TrustyCms<%= class_name %>::VERSION
|
7
|
-
description TrustyCms<%= class_name %>::DESCRIPTION
|
8
|
-
url TrustyCms<%= class_name %>::URL
|
9
|
-
|
10
|
-
# See your config/routes.rb file in this extension to define custom routes
|
11
|
-
|
12
|
-
extension_config do |config|
|
13
|
-
# config is the TrustyCms.configuration object
|
14
|
-
end
|
15
|
-
|
16
|
-
def activate
|
17
|
-
# tab 'Content' do
|
18
|
-
# add_item "<%= extension_name %>", "/admin/<%= file_name %>", :after => "Pages"
|
19
|
-
# end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class <%= class_name %>Test < Test::Unit::TestCase
|
4
|
-
|
5
|
-
# Replace this with your real tests.
|
6
|
-
def test_this_extension
|
7
|
-
flunk
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_initialization
|
11
|
-
assert_equal File.join(File.expand_path(Rails.root), 'vendor', 'extensions', '<%= file_name %>'), <%= class_name %>.root
|
12
|
-
assert_equal '<%= extension_name %>', <%= class_name %>.extension_name
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "radiant-<%= file_name %>-extension"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "radiant-<%= file_name %>-extension"
|
7
|
-
s.version = TrustyCms<%= class_name %>::VERSION
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = TrustyCms<%= class_name %>::AUTHORS
|
10
|
-
s.email = TrustyCms<%= class_name %>::EMAIL
|
11
|
-
s.homepage = TrustyCms<%= class_name %>::URL
|
12
|
-
s.summary = TrustyCms<%= class_name %>::SUMMARY
|
13
|
-
s.description = TrustyCms<%= class_name %>::DESCRIPTION
|
14
|
-
|
15
|
-
# Define gem dependencies here.
|
16
|
-
# Don't include a dependency on radiant itself: it causes problems when radiant is in vendor/radiant.
|
17
|
-
# s.add_dependency "something", "~> 1.0.0"
|
18
|
-
# s.add_dependency "radiant-some-extension", "~> 1.0.0"
|
19
|
-
|
20
|
-
ignores = if File.exist?('.gitignore')
|
21
|
-
File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] }
|
22
|
-
else
|
23
|
-
[]
|
24
|
-
end
|
25
|
-
s.files = Dir['**/*'] - ignores
|
26
|
-
s.test_files = Dir['test/**/*','spec/**/*','features/**/*'] - ignores
|
27
|
-
# s.executables = Dir['bin/*'] - ignores
|
28
|
-
s.require_paths = ["lib"]
|
29
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
module TrustyCms<%= class_name %>
|
2
|
-
VERSION = "1.0.0"
|
3
|
-
SUMMARY = "<%= extension_name %> for TrustyCms CMS"
|
4
|
-
DESCRIPTION = "Makes TrustyCms better by adding <%= file_name %>!"
|
5
|
-
URL = "<%= homepage %>"
|
6
|
-
AUTHORS = ["<%= author_name %>"]
|
7
|
-
EMAIL = ["<%= author_email %>"]
|
8
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
unless defined? TRUSTY_CMS_ROOT
|
2
|
-
ENV["Rails.env"] = "test"
|
3
|
-
case
|
4
|
-
when ENV["RADIANT_ENV_FILE"]
|
5
|
-
require ENV["RADIANT_ENV_FILE"]
|
6
|
-
when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
|
7
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
|
8
|
-
else
|
9
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
require "#{TRUSTY_CMS_ROOT}/spec/spec_helper"
|
13
|
-
|
14
|
-
Dataset::Resolver.default << (File.dirname(__FILE__) + "/datasets")
|
15
|
-
# Include any datasets from loaded extensions
|
16
|
-
TrustyCms::Extension.descendants.each do |extension|
|
17
|
-
if File.directory?(extension.root + "/spec/datasets")
|
18
|
-
Dataset::Resolver.default << (extension.root + "/spec/datasets")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
if File.directory?(File.dirname(__FILE__) + "/matchers")
|
23
|
-
Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
|
24
|
-
end
|
25
|
-
|
26
|
-
Spec::Runner.configure do |config|
|
27
|
-
# config.use_transactional_fixtures = true
|
28
|
-
# config.use_instantiated_fixtures = false
|
29
|
-
# config.fixture_path = Rails.root + '/spec/fixtures'
|
30
|
-
|
31
|
-
# You can declare fixtures for each behaviour like this:
|
32
|
-
# describe "...." do
|
33
|
-
# fixtures :table_a, :table_b
|
34
|
-
#
|
35
|
-
# Alternatively, if you prefer to declare them only once, you can
|
36
|
-
# do so here, like so ...
|
37
|
-
#
|
38
|
-
# config.global_fixtures = :table_a, :table_b
|
39
|
-
#
|
40
|
-
# If you declare global fixtures, be aware that they will be declared
|
41
|
-
# for all of your examples, even those that don't use them.
|
42
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
namespace :radiant do
|
2
|
-
namespace :extensions do
|
3
|
-
namespace :<%= file_name %> do
|
4
|
-
|
5
|
-
desc "Runs the migration of the <%= extension_name %> extension"
|
6
|
-
task :migrate => :environment do
|
7
|
-
require 'trusty_cms/extension_migrator'
|
8
|
-
if ENV["VERSION"]
|
9
|
-
<%= class_name %>.migrator.migrate(ENV["VERSION"].to_i)
|
10
|
-
Rake::Task['db:schema:dump'].invoke
|
11
|
-
else
|
12
|
-
<%= class_name %>.migrator.migrate
|
13
|
-
Rake::Task['db:schema:dump'].invoke
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
desc "Copies public assets of the <%= extension_name %> to the instance public/ directory."
|
18
|
-
task :update => :environment do
|
19
|
-
is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
|
20
|
-
puts "Copying assets from <%= class_name %>"
|
21
|
-
Dir[<%= class_name %>.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
|
22
|
-
path = file.sub(<%= class_name %>.root, '')
|
23
|
-
directory = File.dirname(path)
|
24
|
-
mkdir_p Rails.root + directory, :verbose => false
|
25
|
-
cp file, Rails.root + path, :verbose => false
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Syncs all available translations for this ext to the English ext master"
|
30
|
-
task :sync => :environment do
|
31
|
-
# The main translation root, basically where English is kept
|
32
|
-
language_root = <%= class_name %>.root + "/config/locales"
|
33
|
-
words = TranslationSupport.get_translation_keys(language_root)
|
34
|
-
|
35
|
-
Dir["#{language_root}/*.yml"].each do |filename|
|
36
|
-
next if filename.match('_available_tags')
|
37
|
-
basename = File.basename(filename, '.yml')
|
38
|
-
puts "Syncing #{basename}"
|
39
|
-
(comments, other) = TranslationSupport.read_file(filename, basename)
|
40
|
-
words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist
|
41
|
-
other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml
|
42
|
-
TranslationSupport.write_file(filename, basename, comments, other)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
# Load the environment
|
3
|
-
unless defined? TRUSTY_CMS_ROOT
|
4
|
-
ENV["Rails.env"] = "test"
|
5
|
-
case
|
6
|
-
when ENV["RADIANT_ENV_FILE"]
|
7
|
-
require ENV["RADIANT_ENV_FILE"]
|
8
|
-
when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
|
9
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
|
10
|
-
else
|
11
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
require "#{TRUSTY_CMS_ROOT}/test/test_helper"
|
15
|
-
|
16
|
-
class ActiveSupport::TestCase
|
17
|
-
|
18
|
-
# Include a helper to make testing Radius tags easier
|
19
|
-
test_helper :extension_tags
|
20
|
-
|
21
|
-
# Add the fixture directory to the fixture path
|
22
|
-
self.fixture_path << File.dirname(__FILE__) + "/fixtures"
|
23
|
-
|
24
|
-
# Add more helper methods to be used by all extension tests here...
|
25
|
-
|
26
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
Description:
|
2
|
-
The extension_controller generator creates stubs for a new controller and
|
3
|
-
its views for an extension.
|
4
|
-
|
5
|
-
The generator takes an extension name, controller name, and a list of
|
6
|
-
views as arguments. The controller name may be given in CamelCase or
|
7
|
-
under_score and should not be suffixed with 'Controller'. To create a
|
8
|
-
controller within a module, specify the controller name as
|
9
|
-
'module/controller'.
|
10
|
-
|
11
|
-
The generator creates a controller class in
|
12
|
-
vendor/extension_name/app/controllers with view templates in
|
13
|
-
vendor/extension_name/app/views/controller_name, a helper class in
|
14
|
-
vendor/extension_name/app/helpers, and a functional test suite in
|
15
|
-
vendor/extension_name/test/functional.
|
16
|
-
|
17
|
-
Example:
|
18
|
-
./script/generate extension_controller MyExt Assets list show
|
19
|
-
|
20
|
-
Controller: vendor/my_ext/app/controllers/assets_controller.rb
|
21
|
-
Views: vendor/my_ext/app/views/assets/list.rhtml [...]
|
22
|
-
Helper: vendor/my_ext/app/helpers/assets_helper.rb
|
23
|
-
Spec: vendor/my_ext/spec/controllers/assets_controller_spec.rb
|
24
|
-
Test: vendor/my_ext/test/functional/assets_test.rb (if extension created with "--with-test-unit")
|
25
|
-
|
26
|
-
Modules Example:
|
27
|
-
./script/generate extension_controller MyExt 'admin/assets' upload remove
|
28
|
-
|
29
|
-
Controller: vendor/my_ext/app/controllers/admin/assets_controller.rb
|
30
|
-
Views: vendor/my_ext/app/views/admin/assets/upload.rhtml [...]
|
31
|
-
Helper: vendor/my_ext/app/helpers/admin/assets_helper.rb
|
32
|
-
Spec: vendor/my_ext/spec/controllers/admin/assets_controller_spec.rb
|
33
|
-
Test: vendor/my_ext/test/functional/admin/assets_controller_test.rb (if extension created with "--with-test-unit")
|
34
|
-
|
35
|
-
Note: Once you have created an extension controller you will still need to
|
36
|
-
map routes to the controller in the extension file.
|
@@ -1,84 +0,0 @@
|
|
1
|
-
require 'rails_generator/base'
|
2
|
-
require 'rails_generator/generators/components/controller/controller_generator'
|
3
|
-
|
4
|
-
class ExtensionControllerGenerator < ControllerGenerator
|
5
|
-
|
6
|
-
attr_accessor :extension_name
|
7
|
-
default_options :with_test_unit => false
|
8
|
-
|
9
|
-
def initialize(runtime_args, runtime_options = {})
|
10
|
-
runtime_args = runtime_args.dup
|
11
|
-
@extension_name = runtime_args.shift
|
12
|
-
super(runtime_args, runtime_options)
|
13
|
-
end
|
14
|
-
|
15
|
-
def manifest
|
16
|
-
if extension_uses_rspec?
|
17
|
-
rspec_manifest
|
18
|
-
else
|
19
|
-
super
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def rspec_manifest
|
24
|
-
record do |m|
|
25
|
-
# Check for class naming collisions.
|
26
|
-
m.class_collisions class_path, "#{class_name}Controller", "#{class_name}Helper"
|
27
|
-
|
28
|
-
# Controller, helper, views, and spec directories.
|
29
|
-
m.directory File.join('app/controllers', class_path)
|
30
|
-
m.directory File.join('app/helpers', class_path)
|
31
|
-
m.directory File.join('app/views', class_path, file_name)
|
32
|
-
m.directory File.join('spec/controllers', class_path)
|
33
|
-
m.directory File.join('spec/helpers', class_path)
|
34
|
-
m.directory File.join('spec/views', class_path, file_name)
|
35
|
-
|
36
|
-
# Controller spec, class, and helper.
|
37
|
-
m.template 'controller_spec.rb',
|
38
|
-
File.join('spec/controllers', class_path, "#{file_name}_controller_spec.rb")
|
39
|
-
|
40
|
-
m.template 'helper_spec.rb',
|
41
|
-
File.join('spec/helpers', class_path, "#{file_name}_helper_spec.rb")
|
42
|
-
|
43
|
-
m.template 'controller:controller.rb',
|
44
|
-
File.join('app/controllers', class_path, "#{file_name}_controller.rb")
|
45
|
-
|
46
|
-
m.template 'controller:helper.rb',
|
47
|
-
File.join('app/helpers', class_path, "#{file_name}_helper.rb")
|
48
|
-
|
49
|
-
# Spec and view template for each action.
|
50
|
-
actions.each do |action|
|
51
|
-
m.template 'view_spec.rb',
|
52
|
-
File.join('spec/views', class_path, file_name, "#{action}_view_spec.rb"),
|
53
|
-
:assigns => { :action => action, :model => file_name }
|
54
|
-
path = File.join('app/views', class_path, file_name, "#{action}.html.erb")
|
55
|
-
m.template 'controller:view.html.erb',
|
56
|
-
path,
|
57
|
-
:assigns => { :action => action, :path => path }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def banner
|
63
|
-
"Usage: #{$0} #{spec.name} ExtensionName #{spec.name.camelize}Name [options]"
|
64
|
-
end
|
65
|
-
|
66
|
-
def extension_path
|
67
|
-
File.join('vendor', 'extensions', @extension_name.underscore)
|
68
|
-
end
|
69
|
-
|
70
|
-
def destination_root
|
71
|
-
File.join(Rails.root, extension_path)
|
72
|
-
end
|
73
|
-
|
74
|
-
def extension_uses_rspec?
|
75
|
-
File.exists?(File.join(destination_root, 'spec')) && !options[:with_test_unit]
|
76
|
-
end
|
77
|
-
|
78
|
-
def add_options!(opt)
|
79
|
-
opt.separator ''
|
80
|
-
opt.separator 'Options:'
|
81
|
-
opt.on("--with-test-unit",
|
82
|
-
"Use Test::Unit tests instead sof RSpec.") { |v| options[:with_test_unit] = v }
|
83
|
-
end
|
84
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper'
|
2
|
-
|
3
|
-
describe <%= class_name %>Controller do
|
4
|
-
|
5
|
-
<% if actions.empty? -%>
|
6
|
-
#Delete this example and add some real ones
|
7
|
-
<% else -%>
|
8
|
-
#Delete these examples and add some real ones
|
9
|
-
<% end -%>
|
10
|
-
it "should use <%= class_name %>Controller" do
|
11
|
-
controller.should be_an_instance_of(<%= class_name %>Controller)
|
12
|
-
end
|
13
|
-
|
14
|
-
<% unless actions.empty? -%>
|
15
|
-
<% for action in actions -%>
|
16
|
-
|
17
|
-
it "GET '<%= action %>' should be successful" do
|
18
|
-
get '<%= action %>'
|
19
|
-
response.should be_success
|
20
|
-
end
|
21
|
-
<% end -%>
|
22
|
-
<% end -%>
|
23
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper'
|
2
|
-
|
3
|
-
# Re-raise errors caught by the controller.
|
4
|
-
<%= class_name %>Controller.class_eval { def rescue_action(e) raise e end }
|
5
|
-
|
6
|
-
class <%= class_name %>ControllerTest < ActionController::TestCase
|
7
|
-
# Replace this with your real tests.
|
8
|
-
def test_truth
|
9
|
-
assert true
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper'
|
2
|
-
|
3
|
-
describe <%= class_name %>Helper do
|
4
|
-
|
5
|
-
#Delete this example and add some real ones or delete this file
|
6
|
-
it "should include the <%= class_name %>Helper" do
|
7
|
-
included_modules = self.metaclass.send :included_modules
|
8
|
-
included_modules.should include(<%= class_name %>Helper)
|
9
|
-
end
|
10
|
-
|
11
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper'
|
2
|
-
|
3
|
-
describe "/<%= class_name.underscore %>/<%= action %>" do
|
4
|
-
before do
|
5
|
-
render '<%= class_name.underscore %>/<%= action %>'
|
6
|
-
end
|
7
|
-
|
8
|
-
#Delete this example and add some real ones or delete this file
|
9
|
-
it "should tell you where to find the file" do
|
10
|
-
response.should have_tag('p', 'Find me in app/views/<%= class_name.underscore %>/<%= action %>.rhtml')
|
11
|
-
end
|
12
|
-
end
|