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
data/Vagrantfile
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
# -*- mode: ruby -*-
|
2
|
-
# vi: set ft=ruby :
|
3
|
-
|
4
|
-
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
-
VAGRANTFILE_API_VERSION = "2"
|
6
|
-
|
7
|
-
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
|
-
# All Vagrant configuration is done here. The most common configuration
|
9
|
-
# options are documented and commented below. For a complete reference,
|
10
|
-
# please see the online documentation at vagrantup.com.
|
11
|
-
|
12
|
-
# Every Vagrant virtual environment requires a box to build off of.
|
13
|
-
config.vm.box = "trusty-cms.box"
|
14
|
-
|
15
|
-
# Disable automatic box update checking. If you disable this, then
|
16
|
-
# boxes will only be checked for updates when the user runs
|
17
|
-
# `vagrant box outdated`. This is not recommended.
|
18
|
-
# config.vm.box_check_update = false
|
19
|
-
|
20
|
-
# Create a forwarded port mapping which allows access to a specific port
|
21
|
-
# within the machine from a port on the host machine. In the example below,
|
22
|
-
# accessing "localhost:8080" will access port 80 on the guest machine.
|
23
|
-
config.vm.network "forwarded_port", guest: 3000, host: 3000
|
24
|
-
|
25
|
-
# Create a private network, which allows host-only access to the machine
|
26
|
-
# using a specific IP.
|
27
|
-
# config.vm.network "private_network", ip: "192.168.33.10"
|
28
|
-
|
29
|
-
# Create a public network, which generally matched to bridged network.
|
30
|
-
# Bridged networks make the machine appear as another physical device on
|
31
|
-
# your network.
|
32
|
-
# config.vm.network "public_network"
|
33
|
-
|
34
|
-
# If true, then any SSH connections made will enable agent forwarding.
|
35
|
-
# Default value: false
|
36
|
-
# config.ssh.forward_agent = true
|
37
|
-
|
38
|
-
# Share an additional folder to the guest VM. The first argument is
|
39
|
-
# the path on the host to the actual folder. The second argument is
|
40
|
-
# the path on the guest to mount the folder. And the optional third
|
41
|
-
# argument is a set of non-required options.
|
42
|
-
# config.vm.synced_folder "../data", "/vagrant_data"
|
43
|
-
|
44
|
-
# Provider-specific configuration so you can fine-tune various
|
45
|
-
# backing providers for Vagrant. These expose provider-specific options.
|
46
|
-
# Example for VirtualBox:
|
47
|
-
#
|
48
|
-
# config.vm.provider "virtualbox" do |vb|
|
49
|
-
# # Don't boot with headless mode
|
50
|
-
# vb.gui = true
|
51
|
-
#
|
52
|
-
# # Use VBoxManage to customize the VM. For example to change memory:
|
53
|
-
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
54
|
-
# end
|
55
|
-
#
|
56
|
-
# View the documentation for the provider you're using for more
|
57
|
-
# information on available options.
|
58
|
-
|
59
|
-
# Enable provisioning with CFEngine. CFEngine Community packages are
|
60
|
-
# automatically installed. For example, configure the host as a
|
61
|
-
# policy server and optionally a policy file to run:
|
62
|
-
#
|
63
|
-
# config.vm.provision "cfengine" do |cf|
|
64
|
-
# cf.am_policy_hub = true
|
65
|
-
# # cf.run_file = "motd.cf"
|
66
|
-
# end
|
67
|
-
#
|
68
|
-
# You can also configure and bootstrap a client to an existing
|
69
|
-
# policy server:
|
70
|
-
#
|
71
|
-
# config.vm.provision "cfengine" do |cf|
|
72
|
-
# cf.policy_server_address = "10.0.2.15"
|
73
|
-
# end
|
74
|
-
|
75
|
-
# Enable provisioning with Puppet stand alone. Puppet manifests
|
76
|
-
# are contained in a directory path relative to this Vagrantfile.
|
77
|
-
# You will need to create the manifests directory and a manifest in
|
78
|
-
# the file default.pp in the manifests_path directory.
|
79
|
-
#
|
80
|
-
# config.vm.provision "puppet" do |puppet|
|
81
|
-
# puppet.manifests_path = "manifests"
|
82
|
-
# puppet.manifest_file = "site.pp"
|
83
|
-
# end
|
84
|
-
|
85
|
-
# Enable provisioning with chef solo, specifying a cookbooks path, roles
|
86
|
-
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
87
|
-
# some recipes and/or roles.
|
88
|
-
#
|
89
|
-
# config.vm.provision "chef_solo" do |chef|
|
90
|
-
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
91
|
-
# chef.roles_path = "../my-recipes/roles"
|
92
|
-
# chef.data_bags_path = "../my-recipes/data_bags"
|
93
|
-
# chef.add_recipe "mysql"
|
94
|
-
# chef.add_role "web"
|
95
|
-
#
|
96
|
-
# # You may also specify custom JSON attributes:
|
97
|
-
# chef.json = { mysql_password: "foo" }
|
98
|
-
# end
|
99
|
-
|
100
|
-
# Enable provisioning with chef server, specifying the chef server URL,
|
101
|
-
# and the path to the validation key (relative to this Vagrantfile).
|
102
|
-
#
|
103
|
-
# The Opscode Platform uses HTTPS. Substitute your organization for
|
104
|
-
# ORGNAME in the URL and validation key.
|
105
|
-
#
|
106
|
-
# If you have your own Chef Server, use the appropriate URL, which may be
|
107
|
-
# HTTP instead of HTTPS depending on your configuration. Also change the
|
108
|
-
# validation key to validation.pem.
|
109
|
-
#
|
110
|
-
# config.vm.provision "chef_client" do |chef|
|
111
|
-
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
112
|
-
# chef.validation_key_path = "ORGNAME-validator.pem"
|
113
|
-
# end
|
114
|
-
#
|
115
|
-
# If you're using the Opscode platform, your validator client is
|
116
|
-
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
117
|
-
#
|
118
|
-
# If you have your own Chef Server, the default validation client name is
|
119
|
-
# chef-validator, unless you changed the configuration.
|
120
|
-
#
|
121
|
-
# chef.validation_client_name = "ORGNAME-validator"
|
122
|
-
end
|
data/bin/ci/before_script
DELETED
data/bin/trusty_test
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Description:
|
2
|
-
The extension generator creates stubs for a new TrustyCms extension.
|
3
|
-
|
4
|
-
The generator takes an extension name as its argument. The extension name may be
|
5
|
-
given in CamelCase or under_score and should not be suffixed with 'Extension'.
|
6
|
-
|
7
|
-
The generator creates an extension directory in vendor/extensions that includes
|
8
|
-
<extension_name>_extension.rb, README and Rakefile files as well as db, lib, task,
|
9
|
-
and test directories.
|
10
|
-
|
11
|
-
Example:
|
12
|
-
./script/generate extension AssetManagement
|
13
|
-
|
14
|
-
This will create:
|
15
|
-
vendor/extensions/asset_management/app/controllers
|
16
|
-
vendor/extensions/asset_management/app/helpers
|
17
|
-
vendor/extensions/asset_management/app/models
|
18
|
-
vendor/extensions/asset_management/app/views
|
19
|
-
vendor/extensions/asset_management/db/migrate
|
20
|
-
vendor/extensions/asset_management/lib/tasks
|
21
|
-
vendor/extensions/asset_management/README
|
22
|
-
vendor/extensions/asset_management/asset_management_extension.rb
|
23
|
-
vendor/extensions/asset_management/lib/tasks/asset_management_extension_tasks.rake
|
24
|
-
vendor/extensions/asset_management/spec/controllers
|
25
|
-
vendor/extensions/asset_management/spec/models
|
26
|
-
vendor/extensions/asset_management/spec/views
|
27
|
-
vendor/extensions/asset_management/spec/helpers
|
28
|
-
vendor/extensions/asset_management/Rakefile
|
29
|
-
vendor/extensions/asset_management/spec/spec_helper.rb
|
30
|
-
vendor/extensions/asset_management/spec/spec.opts
|
@@ -1,97 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'git'
|
3
|
-
rescue LoadError
|
4
|
-
end
|
5
|
-
|
6
|
-
class ExtensionGenerator < Rails::Generator::NamedBase
|
7
|
-
default_options :with_test_unit => false
|
8
|
-
|
9
|
-
attr_reader :extension_path, :extension_file_name
|
10
|
-
|
11
|
-
def initialize(runtime_args, runtime_options = {})
|
12
|
-
super
|
13
|
-
@extension_file_name = "#{file_name}_extension"
|
14
|
-
@extension_path = "vendor/extensions/#{file_name}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def manifest
|
18
|
-
record do |m|
|
19
|
-
m.directory "#{extension_path}/app/controllers"
|
20
|
-
m.directory "#{extension_path}/app/helpers"
|
21
|
-
m.directory "#{extension_path}/app/models"
|
22
|
-
m.directory "#{extension_path}/app/views"
|
23
|
-
m.directory "#{extension_path}/config/locales"
|
24
|
-
m.directory "#{extension_path}/config/initializers"
|
25
|
-
m.directory "#{extension_path}/db/migrate"
|
26
|
-
m.directory "#{extension_path}/lib/tasks"
|
27
|
-
|
28
|
-
m.template 'README.md', "#{extension_path}/README.md"
|
29
|
-
m.template 'extension.rb', "#{extension_path}/#{extension_file_name}.rb"
|
30
|
-
m.template 'tasks.rake', "#{extension_path}/lib/tasks/#{extension_file_name}_tasks.rake"
|
31
|
-
m.template 'en.yml', "#{extension_path}/config/locales/en.yml"
|
32
|
-
m.template 'routes.rb', "#{extension_path}/config/routes.rb"
|
33
|
-
m.template 'radiant_config.rb', "#{extension_path}/config/initializers/radiant_config.rb"
|
34
|
-
m.template 'lib.rb', "#{extension_path}/lib/radiant-#{file_name}-extension.rb"
|
35
|
-
m.template 'gemspec.rb', "#{extension_path}/radiant-#{file_name}-extension.gemspec"
|
36
|
-
|
37
|
-
if options[:with_test_unit]
|
38
|
-
m.directory "#{extension_path}/test/fixtures"
|
39
|
-
m.directory "#{extension_path}/test/functional"
|
40
|
-
m.directory "#{extension_path}/test/unit"
|
41
|
-
|
42
|
-
m.template 'Rakefile', "#{extension_path}/Rakefile"
|
43
|
-
m.template 'test_helper.rb', "#{extension_path}/test/test_helper.rb"
|
44
|
-
m.template 'functional_test.rb', "#{extension_path}/test/functional/#{extension_file_name}_test.rb"
|
45
|
-
else
|
46
|
-
m.directory "#{extension_path}/spec/controllers"
|
47
|
-
m.directory "#{extension_path}/spec/models"
|
48
|
-
m.directory "#{extension_path}/spec/views"
|
49
|
-
m.directory "#{extension_path}/spec/helpers"
|
50
|
-
m.directory "#{extension_path}/features/support"
|
51
|
-
m.directory "#{extension_path}/features/step_definitions/admin"
|
52
|
-
|
53
|
-
m.template 'RSpecRakefile', "#{extension_path}/Rakefile"
|
54
|
-
m.template 'spec_helper.rb', "#{extension_path}/spec/spec_helper.rb"
|
55
|
-
m.file 'spec.opts', "#{extension_path}/spec/spec.opts"
|
56
|
-
m.file 'cucumber.yml', "#{extension_path}/cucumber.yml"
|
57
|
-
m.template 'cucumber_env.rb', "#{extension_path}/features/support/env.rb"
|
58
|
-
m.template 'cucumber_paths.rb', "#{extension_path}/features/support/paths.rb"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def class_name
|
64
|
-
super.to_name.gsub(' ', '') + 'Extension'
|
65
|
-
end
|
66
|
-
|
67
|
-
def extension_name
|
68
|
-
class_name.to_name('Extension')
|
69
|
-
end
|
70
|
-
|
71
|
-
def author_info
|
72
|
-
@author_info ||= begin
|
73
|
-
Git.global_config
|
74
|
-
rescue NameError
|
75
|
-
{}
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def homepage
|
80
|
-
author_info['github.user'] ? "http://github.com/#{author_info['github.user']}/radiant-#{file_name}-extension" : "http://example.com/#{file_name}"
|
81
|
-
end
|
82
|
-
|
83
|
-
def author_email
|
84
|
-
author_info['user.email'] || 'your email'
|
85
|
-
end
|
86
|
-
|
87
|
-
def author_name
|
88
|
-
author_info['user.name'] || 'Your Name'
|
89
|
-
end
|
90
|
-
|
91
|
-
def add_options!(opt)
|
92
|
-
opt.separator ''
|
93
|
-
opt.separator 'Options:'
|
94
|
-
opt.on("--with-test-unit",
|
95
|
-
"Use Test::Unit for this extension instead of RSpec") { |v| options[:with_test_unit] = v }
|
96
|
-
end
|
97
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
# <%= extension_name %>
|
2
|
-
|
3
|
-
TrustyCms is _so_ freaking awesome, but I made it better through this extension.
|
4
|
-
|
5
|
-
Created by <%= author_name %>. <%- if author_email.include?('@') -%>If I don't update this content with real details,
|
6
|
-
please contact me at <%= author_email %> with annoying messages telling me to do it.<%- end -%>
|
@@ -1,109 +0,0 @@
|
|
1
|
-
# Determine where the RSpec plugin is by loading the boot
|
2
|
-
unless defined? TRUSTY_CMS_ROOT
|
3
|
-
ENV["Rails.env"] = "test"
|
4
|
-
case
|
5
|
-
when ENV["RADIANT_ENV_FILE"]
|
6
|
-
require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
|
7
|
-
when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
|
8
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
9
|
-
else
|
10
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
require 'rake'
|
15
|
-
require 'rdoc/task'
|
16
|
-
require 'rake/testtask'
|
17
|
-
|
18
|
-
rspec_base = File.expand_path(TRUSTY_CMS_ROOT + '/vendor/plugins/rspec/lib')
|
19
|
-
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
20
|
-
require 'spec/rake/spectask'
|
21
|
-
require 'cucumber'
|
22
|
-
require 'cucumber/rake/task'
|
23
|
-
|
24
|
-
# Cleanup the TRUSTY_CMS_ROOT constant so specs will load the environment
|
25
|
-
Object.send(:remove_const, :TRUSTY_CMS_ROOT)
|
26
|
-
|
27
|
-
extension_root = File.expand_path(File.dirname(__FILE__))
|
28
|
-
|
29
|
-
task :default => [:spec, :features]
|
30
|
-
task :stats => "spec:statsetup"
|
31
|
-
|
32
|
-
desc "Run all specs in spec directory"
|
33
|
-
Spec::Rake::SpecTask.new(:spec) do |t|
|
34
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
35
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
36
|
-
end
|
37
|
-
|
38
|
-
task :features => 'spec:integration'
|
39
|
-
|
40
|
-
namespace :spec do
|
41
|
-
desc "Run all specs in spec directory with RCov"
|
42
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
43
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
44
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
45
|
-
t.rcov = true
|
46
|
-
t.rcov_opts = ['--exclude', 'spec', '--rails']
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Print Specdoc for all specs"
|
50
|
-
Spec::Rake::SpecTask.new(:doc) do |t|
|
51
|
-
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
52
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
53
|
-
end
|
54
|
-
|
55
|
-
[:models, :controllers, :views, :helpers].each do |sub|
|
56
|
-
desc "Run the specs under spec/#{sub}"
|
57
|
-
Spec::Rake::SpecTask.new(sub) do |t|
|
58
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
59
|
-
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
desc "Run the Cucumber features"
|
64
|
-
Cucumber::Rake::Task.new(:integration) do |t|
|
65
|
-
t.fork = true
|
66
|
-
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
|
67
|
-
# t.feature_pattern = "#{extension_root}/features/**/*.feature"
|
68
|
-
t.profile = "default"
|
69
|
-
end
|
70
|
-
|
71
|
-
# Setup specs for stats
|
72
|
-
task :statsetup do
|
73
|
-
require 'code_statistics'
|
74
|
-
::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
75
|
-
::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
76
|
-
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
77
|
-
::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
78
|
-
::CodeStatistics::TEST_TYPES << "Model specs"
|
79
|
-
::CodeStatistics::TEST_TYPES << "View specs"
|
80
|
-
::CodeStatistics::TEST_TYPES << "Controller specs"
|
81
|
-
::CodeStatistics::TEST_TYPES << "Helper specs"
|
82
|
-
::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
83
|
-
end
|
84
|
-
|
85
|
-
namespace :db do
|
86
|
-
namespace :fixtures do
|
87
|
-
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
88
|
-
task :load => :environment do
|
89
|
-
require 'active_record/fixtures'
|
90
|
-
ActiveRecord::Base.establish_connection(Rails.env.to_sym)
|
91
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
92
|
-
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
desc 'Generate documentation for the <%= file_name %> extension.'
|
100
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
101
|
-
rdoc.rdoc_dir = 'rdoc'
|
102
|
-
rdoc.title = '<%= class_name %>'
|
103
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
104
|
-
rdoc.rdoc_files.include('README')
|
105
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
106
|
-
end
|
107
|
-
|
108
|
-
# Load any custom rakefiles for extension
|
109
|
-
Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rdoc/task'
|
4
|
-
|
5
|
-
desc 'Default: run unit tests.'
|
6
|
-
task :default => :test
|
7
|
-
|
8
|
-
desc 'Test the <%= file_name %> extension.'
|
9
|
-
Rake::TestTask.new(:test) do |t|
|
10
|
-
t.libs << 'lib'
|
11
|
-
t.pattern = 'test/**/*_test.rb'
|
12
|
-
t.verbose = true
|
13
|
-
end
|
14
|
-
|
15
|
-
desc 'Generate documentation for the <%= file_name %> extension.'
|
16
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
17
|
-
rdoc.rdoc_dir = 'rdoc'
|
18
|
-
rdoc.title = '<%= class_name %>'
|
19
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
20
|
-
rdoc.rdoc_files.include('README')
|
21
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
22
|
-
end
|
23
|
-
|
24
|
-
# Load any custom rakefiles for extension
|
25
|
-
Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|
@@ -1 +0,0 @@
|
|
1
|
-
default: --format progress features --tags ~@proposed,~@in_progress
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Sets up the Rails environment for Cucumber
|
2
|
-
ENV["Rails.env"] = "test"
|
3
|
-
# Extension root
|
4
|
-
extension_env = File.expand_path(File.dirname(__FILE__) + '/../../../../../config/environment')
|
5
|
-
require extension_env+'.rb'
|
6
|
-
|
7
|
-
Dir.glob(File.join(TRUSTY_CMS_ROOT, "features", "**", "*.rb")).each {|step| require step unless step =~ /datasets_loader\.rb$/}
|
8
|
-
|
9
|
-
Cucumber::Rails::World.class_eval do
|
10
|
-
dataset :<%= file_name %>
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module NavigationHelpers
|
2
|
-
|
3
|
-
# Extend the standard PathMatchers with your own paths
|
4
|
-
# to be used in your features.
|
5
|
-
#
|
6
|
-
# The keys and values here may be used in your standard web steps
|
7
|
-
# Using:
|
8
|
-
#
|
9
|
-
# When I go to the "<%= file_name %>" admin page
|
10
|
-
#
|
11
|
-
# would direct the request to the path you provide in the value:
|
12
|
-
#
|
13
|
-
# admin_<%= file_name %>_path
|
14
|
-
#
|
15
|
-
PathMatchers = {} unless defined?(PathMatchers)
|
16
|
-
PathMatchers.merge!({
|
17
|
-
# /<%= file_name %>/i => 'admin_<%= file_name %>_path'
|
18
|
-
})
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
World(NavigationHelpers)
|