masterview_plugin_generator 0.2.5 → 0.3.0
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/templates/init.rb +1 -1
- data/templates/masterview.rake +12 -8
- data/templates/settings.rb +2 -1
- metadata +2 -2
data/templates/init.rb
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
# config.enable_admin_pages = false
|
46
46
|
# config.default_parser_options[:tidy] = true
|
47
47
|
# config.tidy_path = '/usr/lib/libtidy.so'
|
48
|
-
# config.
|
48
|
+
# config.add_directive_path File.join( RAILS_ROOT, 'masterview-ext', 'directives' )
|
49
49
|
#
|
50
50
|
# To customize the configuration for the current Rails environment,
|
51
51
|
# provide a +config/masterview/environments/#{environment}.rb+ file
|
data/templates/masterview.rake
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# load MasterView engine with the std config (uses app config settings when in rails app)
|
4
4
|
mv_lib_dir_path = File.join( File.dirname(__FILE__), '../lib' )
|
5
|
-
|
5
|
+
MV_ADMIN_CONTROLLER_INSTALL_DIR_PATH = File.join( mv_lib_dir_path, 'masterview/extras' ) # ./app/views/masterview
|
6
6
|
|
7
7
|
# doing load and require this way so that it works from both gems and plugin install
|
8
8
|
$LOAD_PATH.push( mv_lib_dir_path )
|
@@ -16,7 +16,7 @@ namespace :mv do
|
|
16
16
|
task :list do
|
17
17
|
template_specs, content_hash = MasterView::TemplateSpec.scan
|
18
18
|
@template_specs_sorted = template_specs.sort
|
19
|
-
@template_specs_sorted.each do |path, ts|
|
19
|
+
@template_specs_sorted.each do |path, ts|
|
20
20
|
puts "#{path}\t#{ts.status}\t#{ts.message}"
|
21
21
|
end
|
22
22
|
end
|
@@ -25,12 +25,12 @@ namespace :mv do
|
|
25
25
|
task :list_all do
|
26
26
|
template_specs, content_hash = MasterView::TemplateSpec.scan
|
27
27
|
@template_specs_sorted = template_specs.sort
|
28
|
-
@template_specs_sorted.each do |path, ts|
|
28
|
+
@template_specs_sorted.each do |path, ts|
|
29
29
|
puts "#{path}\t#{ts.status}\t#{ts.message}"
|
30
30
|
puts "\tgenerates: #{ts.gen_parts.join(', ')}\n\n"
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
desc 'Rebuild/update template imports, specify TEMPLATE=foo/bar.html'
|
35
35
|
task :rebuild do
|
36
36
|
raise "Usage: rake mv:rebuild TEMPLATE=foo/bar.html" unless ENV['TEMPLATE']
|
@@ -66,7 +66,7 @@ namespace :mv do
|
|
66
66
|
|
67
67
|
# checks app path first for views and files, then falls back to files in MV installation dir
|
68
68
|
def find_path(path)
|
69
|
-
mv_path = File.join(
|
69
|
+
mv_path = File.join( MV_ADMIN_CONTROLLER_INSTALL_DIR_PATH, path )
|
70
70
|
working_path = (File.exist?(path)) ? path : mv_path
|
71
71
|
end
|
72
72
|
|
@@ -84,13 +84,17 @@ namespace :mv do
|
|
84
84
|
puts dst_file+' created'
|
85
85
|
end
|
86
86
|
|
87
|
-
desc "Run parser manually on masterview html files to generate the erb/rhtml files"
|
87
|
+
desc "Run parser manually on masterview html files to parse and generate the erb/rhtml files"
|
88
88
|
task :parse do
|
89
89
|
MasterView::IOMgr.template.find(:pattern => MasterView::TemplateFilenamePattern ) do |mio|
|
90
90
|
puts 'Generated erb/rhtml files from '+mio.pathname.to_s
|
91
91
|
MasterView::Parser.parse_mio(mio, MasterView::IOMgr.erb)
|
92
92
|
end
|
93
|
-
|
93
|
+
if MasterView::ConfigSettings.generate_rhtml_files
|
94
|
+
puts 'Generated erb/rhtml output was created in app/views/** tree'
|
95
|
+
else
|
96
|
+
puts "\nNote: config.generate_rhtml_files was false, so rails reads erb/rhtml directly from MasterView, and thus files were parsed but not serialized to file system. Set config.generate_rhtml_files = true (in config/masterview/settings.rb) and rerun this command to generate rhtml to the file system"
|
97
|
+
end
|
94
98
|
end
|
95
99
|
|
96
100
|
desc "View erb/rhtml that masterview generated - specify rhtml name like RHTML=product/_form.rhtml or RHTML=layouts/product.rhtml"
|
@@ -99,7 +103,7 @@ namespace :mv do
|
|
99
103
|
rhtml_file = ENV['RHTML']
|
100
104
|
|
101
105
|
# make sure they are parsed
|
102
|
-
string_hash_mio_tree = MasterView::StringHashMIOTree.new( {}, MasterView::
|
106
|
+
string_hash_mio_tree = MasterView::MIO::StringHashMIOTree.new( {}, MasterView::ConfigSettings.generated_file_default_extension )
|
103
107
|
MasterView::IOMgr.template.find(:pattern => MasterView::TemplateFilenamePattern ) do |mio|
|
104
108
|
MasterView::Parser.parse_mio(mio, string_hash_mio_tree)
|
105
109
|
end
|
data/templates/settings.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
#config.root_path = RAILS_ROOT
|
18
18
|
#config.config_dir_path = 'config/masterview' # relative path from config.root_path
|
19
19
|
#config.environment = RAILS_ENV
|
20
|
-
#config.
|
20
|
+
#config.add_directive_path '/path/to/custom/directives'
|
21
21
|
#config.logger = 'log4r'
|
22
22
|
#config.log_level = 'WARN'
|
23
23
|
#config.after_initialize { MasterView::Log.level = 'DEBUG' }
|
@@ -46,6 +46,7 @@
|
|
46
46
|
#config.tidy_path = '/usr/lib/libtidy.so' # *nix
|
47
47
|
#config.tidy_path = 'c:/tidy/lib/tidy.dll' # Win32
|
48
48
|
#config.namespace_prefix = 'mv:'
|
49
|
+
#config.namespace_prefix_extensions = 'mvx:'
|
49
50
|
#config.inline_erb_start = '{{{'
|
50
51
|
#config.inline_erb_end = '}}}'
|
51
52
|
#config.inline_erb_substitution_regex = /\{\{\{(([^}]|\}[^}]|\}\}[^}])*)\}\}\}/
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: masterview_plugin_generator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-08
|
6
|
+
version: 0.3.0
|
7
|
+
date: 2006-11-08 00:00:00 -06:00
|
8
8
|
summary: A (x)html friendly template engine for rails with the power of layouts, and partials. MasterView Plugin Generator for GEM
|
9
9
|
require_paths:
|
10
10
|
- .
|