radiant-site_templates-extension 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -0
- data/Rakefile +136 -0
- data/db/templates/empty.yml +2 -0
- data/db/templates/roasters.yml +7826 -0
- data/db/templates/simple-blog.yml +251 -0
- data/db/templates/styled-blog.yml +535 -0
- data/lib/radiant-site_templates-extension/version.rb +3 -0
- data/lib/radiant-site_templates-extension.rb +2 -0
- data/lib/tasks/site_templates_extension_tasks.rake +55 -0
- data/public/images/roasters/banner.jpg +0 -0
- data/public/images/roasters/closelabel.gif +0 -0
- data/public/images/roasters/comment.png +0 -0
- data/public/images/roasters/gallery1.jpg +0 -0
- data/public/images/roasters/gallery2.jpg +0 -0
- data/public/images/roasters/gallery3.jpg +0 -0
- data/public/images/roasters/gallery4.jpg +0 -0
- data/public/images/roasters/gift.gif +0 -0
- data/public/images/roasters/green.gif +0 -0
- data/public/images/roasters/nav-background.gif +0 -0
- data/public/images/roasters/nav-divider.gif +0 -0
- data/public/images/roasters/nextlabel.gif +0 -0
- data/public/images/roasters/open.gif +0 -0
- data/public/images/roasters/preview-1.jpg +0 -0
- data/public/images/roasters/preview.jpg +0 -0
- data/public/images/roasters/prevlabel.gif +0 -0
- data/public/images/roasters/prize.gif +0 -0
- data/public/images/roasters/recycle.gif +0 -0
- data/public/images/roasters/rss.gif +0 -0
- data/public/images/roasters/thumb-grinder.jpg +0 -0
- data/public/images/roasters/thumb-grower.jpg +0 -0
- data/public/images/roasters/thumb-roaster.jpg +0 -0
- data/public/images/roasters/truck.gif +0 -0
- data/radiant-site_templates-extension.gemspec +30 -0
- data/site_templates_extension.rb +8 -0
- metadata +101 -0
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
Jeweler::Tasks.new do |gem|
|
4
|
+
gem.name = "radiant-site_templates-extension"
|
5
|
+
gem.summary = %Q{Site Templates Extension for Radiant CMS}
|
6
|
+
gem.description = %Q{Describe your extension here}
|
7
|
+
gem.email = "jim@saturnflyer.com"
|
8
|
+
gem.homepage = "http://github.com/saturnflyer/radiant-site_templates-extension"
|
9
|
+
gem.authors = ["Jim Gay"]
|
10
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
11
|
+
end
|
12
|
+
rescue LoadError
|
13
|
+
puts "Jeweler (or a dependency) not available. This is only required if you plan to package site_templates as a gem."
|
14
|
+
end
|
15
|
+
|
16
|
+
# In rails 1.2, plugins aren't available in the path until they're loaded.
|
17
|
+
# Check to see if the rspec plugin is installed first and require
|
18
|
+
# it if it is. If not, use the gem version.
|
19
|
+
|
20
|
+
# Determine where the RSpec plugin is by loading the boot
|
21
|
+
unless defined? RADIANT_ROOT
|
22
|
+
ENV["RAILS_ENV"] = "test"
|
23
|
+
case
|
24
|
+
when ENV["RADIANT_ENV_FILE"]
|
25
|
+
require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
|
26
|
+
when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
|
27
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
28
|
+
else
|
29
|
+
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
require 'rake'
|
34
|
+
require 'rake/rdoctask'
|
35
|
+
require 'rake/testtask'
|
36
|
+
|
37
|
+
rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
|
38
|
+
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
39
|
+
require 'spec/rake/spectask'
|
40
|
+
require 'cucumber'
|
41
|
+
require 'cucumber/rake/task'
|
42
|
+
|
43
|
+
# Cleanup the RADIANT_ROOT constant so specs will load the environment
|
44
|
+
Object.send(:remove_const, :RADIANT_ROOT)
|
45
|
+
|
46
|
+
extension_root = File.expand_path(File.dirname(__FILE__))
|
47
|
+
|
48
|
+
task :default => :spec
|
49
|
+
task :stats => "spec:statsetup"
|
50
|
+
|
51
|
+
desc "Run all specs in spec directory"
|
52
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
53
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
54
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
55
|
+
end
|
56
|
+
|
57
|
+
task :features => 'spec:integration'
|
58
|
+
|
59
|
+
namespace :spec do
|
60
|
+
desc "Run all specs in spec directory with RCov"
|
61
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
62
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
63
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
64
|
+
t.rcov = true
|
65
|
+
t.rcov_opts = ['--exclude', 'spec', '--rails']
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Print Specdoc for all specs"
|
69
|
+
Spec::Rake::SpecTask.new(:doc) do |t|
|
70
|
+
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
71
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
72
|
+
end
|
73
|
+
|
74
|
+
[:models, :controllers, :views, :helpers].each do |sub|
|
75
|
+
desc "Run the specs under spec/#{sub}"
|
76
|
+
Spec::Rake::SpecTask.new(sub) do |t|
|
77
|
+
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
78
|
+
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Run the Cucumber features"
|
83
|
+
Cucumber::Rake::Task.new(:integration) do |t|
|
84
|
+
t.fork = true
|
85
|
+
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
|
86
|
+
# t.feature_pattern = "#{extension_root}/features/**/*.feature"
|
87
|
+
t.profile = "default"
|
88
|
+
end
|
89
|
+
|
90
|
+
# Setup specs for stats
|
91
|
+
task :statsetup do
|
92
|
+
require 'code_statistics'
|
93
|
+
::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
94
|
+
::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
95
|
+
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
96
|
+
::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
97
|
+
::CodeStatistics::TEST_TYPES << "Model specs"
|
98
|
+
::CodeStatistics::TEST_TYPES << "View specs"
|
99
|
+
::CodeStatistics::TEST_TYPES << "Controller specs"
|
100
|
+
::CodeStatistics::TEST_TYPES << "Helper specs"
|
101
|
+
::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
102
|
+
end
|
103
|
+
|
104
|
+
namespace :db do
|
105
|
+
namespace :fixtures do
|
106
|
+
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
107
|
+
task :load => :environment do
|
108
|
+
require 'active_record/fixtures'
|
109
|
+
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
110
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
111
|
+
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
desc 'Generate documentation for the site_templates extension.'
|
119
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
120
|
+
rdoc.rdoc_dir = 'rdoc'
|
121
|
+
rdoc.title = 'SiteTemplatesExtension'
|
122
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
123
|
+
rdoc.rdoc_files.include('README')
|
124
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
125
|
+
end
|
126
|
+
|
127
|
+
# For extensions that are in transition
|
128
|
+
desc 'Test the site_templates extension.'
|
129
|
+
Rake::TestTask.new(:test) do |t|
|
130
|
+
t.libs << 'lib'
|
131
|
+
t.pattern = 'test/**/*_test.rb'
|
132
|
+
t.verbose = true
|
133
|
+
end
|
134
|
+
|
135
|
+
# Load any custom rakefiles for extension
|
136
|
+
Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|