hobo 0.6.4 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/hobo +4 -6
- data/hobo_files/plugin/CHANGES.txt +170 -0
- data/hobo_files/plugin/generators/hobo_front_controller/templates/index.dryml +9 -9
- data/hobo_files/plugin/generators/hobo_front_controller/templates/search.dryml +9 -9
- data/hobo_files/plugin/generators/hobo_migration/hobo_migration_generator.rb +7 -2
- data/hobo_files/plugin/generators/hobo_rapid/hobo_rapid_generator.rb +4 -4
- data/hobo_files/plugin/generators/hobo_rapid/templates/{hobo_rapid.css → hobo-rapid.css} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/{hobo_rapid.js → hobo-rapid.js} +66 -47
- data/hobo_files/plugin/generators/hobo_rapid/templates/lowpro.js +130 -44
- data/hobo_files/plugin/generators/hobo_rapid/templates/{hobo_base.css → reset.css} +0 -5
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/pencil.png +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/small_close.png +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/application.css +45 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid_ui.css +167 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/views/application.dryml +10 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_bodytop.gif → bkg-bodytop.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_corner_01.gif → bkg-corner-01.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_corner_02.gif → bkg-corner-02.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_corner_03.gif → bkg-corner-03.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_corner_04.gif → bkg-corner-04.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_shadow_bottom.gif → bkg-shadow-bottom.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_shadow_left.gif → bkg-shadow-left.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_shadow_right.gif → bkg-shadow-right.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{bkg_shadow_top.gif → bkg-shadow-top.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{header_blue.gif → header-blue.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{header_dblue.gif → header-dblue.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{header_green.gif → header-green.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{header_purple.gif → header-purple.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{header_red.gif → header-red.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{txt_list_img_dblue.gif → txt-list-img-dblue.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{txt_list_img_green.gif → txt-list-img-green.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{txt_list_img_purple.gif → txt-list-img-purple.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{txt_list_img_red.gif → txt-list-img-red.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_corner_01.gif → window-corner-01.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_corner_02.gif → window-corner-02.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_corner_03.gif → window-corner-03.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_corner_04.gif → window-corner-04.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_shadow_bottom.gif → window-shadow-bottom.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_shadow_left.gif → window-shadow-left.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_shadow_right.gif → window-shadow-right.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/{window_shadow_top.gif → window-shadow-top.gif} +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css +69 -69
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views/application.dryml +39 -53
- data/hobo_files/plugin/generators/hobo_user_model/templates/model.rb +1 -1
- data/hobo_files/plugin/lib/extensions.rb +0 -16
- data/hobo_files/plugin/lib/hobo/dryml/part_context.rb +1 -1
- data/hobo_files/plugin/lib/hobo/dryml/tag_parameters.rb +35 -0
- data/hobo_files/plugin/lib/hobo/dryml/taglib.rb +2 -2
- data/hobo_files/plugin/lib/hobo/dryml/template.rb +165 -236
- data/hobo_files/plugin/lib/hobo/dryml/template_environment.rb +158 -123
- data/hobo_files/plugin/lib/hobo/hobo_helper.rb +15 -4
- data/hobo_files/plugin/lib/hobo/model.rb +30 -11
- data/hobo_files/plugin/lib/hobo/model_controller.rb +13 -9
- data/hobo_files/plugin/lib/hobo/model_router.rb +27 -7
- data/hobo_files/plugin/lib/hobo/static_tags +0 -2
- data/hobo_files/plugin/lib/hobo/user.rb +3 -3
- data/hobo_files/plugin/lib/rexml.rb +10 -3
- data/hobo_files/plugin/tags/core.dryml +11 -16
- data/hobo_files/plugin/tags/rapid.dryml +147 -110
- data/hobo_files/plugin/tags/rapid_document_tags.dryml +22 -20
- data/hobo_files/plugin/tags/rapid_editing.dryml +41 -41
- data/hobo_files/plugin/tags/rapid_forms.dryml +51 -49
- data/hobo_files/plugin/tags/rapid_navigation.dryml +34 -34
- data/hobo_files/plugin/tags/rapid_pages.dryml +174 -174
- data/hobo_files/plugin/tags/rapid_plus.dryml +19 -19
- data/hobo_files/plugin/tags/rapid_support.dryml +5 -5
- data/hobo_files/plugin/tasks/dump_fixtures.rake +62 -53
- data/hobo_files/plugin/tasks/fix_dryml.rake +144 -0
- data/hobo_files/plugin/tasks/hobo_tasks.rake +0 -4
- metadata +43 -32
- data/hobo_files/plugin/lib/hobo/dryml/tag_module.rb +0 -9
@@ -1,43 +1,43 @@
|
|
1
|
-
<def tag="
|
1
|
+
<def tag="table-plus" attrs="sort-field, sort-direction, sort-columns" >
|
2
2
|
<% sort_field ||= @sort_field; sort_direction ||= @sort_direction; sort_columns ||= {} %>
|
3
|
-
<div class="
|
3
|
+
<div class="table-plus" merge-attrs="&attributes - attrs_for(:with_fields) - attrs_for(:table)">
|
4
4
|
<div class="header" param="header">
|
5
5
|
<div class="search">
|
6
|
-
<form param="
|
7
|
-
<
|
6
|
+
<form param="search-form" method="get" action="">
|
7
|
+
<hidden-fields for-query-string skip="page, search_form"/>
|
8
8
|
Search
|
9
|
-
<input class="
|
10
|
-
<submit label="Go" class="
|
9
|
+
<input class="search-field" type="search" name="search" value="¶ms[:search]"/>
|
10
|
+
<submit label="Go" class="search-button" param="search-submit"/>
|
11
11
|
</form>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
14
|
|
15
|
-
<
|
16
|
-
<
|
17
|
-
<
|
15
|
+
<table merge-attrs="&attributes & (attrs_for(:table) + attrs_for(:with_fields))" merge-params>
|
16
|
+
<field-heading-row:>
|
17
|
+
<with-field-names merge-attrs="&all_attributes & attrs_for(:with_fields)">
|
18
18
|
<% col = sort_columns[scope.field_path] || scope.field_path
|
19
19
|
sort = sort_field == col && sort_direction == 'asc' ?
|
20
20
|
"-#{col}" : col
|
21
21
|
sort_url = url_for(params.merge(:sort => sort) - [:page]) %>
|
22
22
|
|
23
|
-
<th param="#{scope.
|
24
|
-
<a href="&sort_url" class="
|
25
|
-
param="#{scope.
|
23
|
+
<th param="#{scope.field-name}-heading">
|
24
|
+
<a href="&sort_url" class="column-sort"
|
25
|
+
param="#{scope.field-name}-heading-link"><%= scope.field_name.titleize %></a>
|
26
26
|
<if test="&col == sort_field">
|
27
|
-
<do param="
|
28
|
-
<do param="
|
27
|
+
<do param="up-arrow" if="&sort_direction == 'desc'">↑</do>
|
28
|
+
<do param="down-arrow" if="&sort_direction == 'asc'">↓</do>
|
29
29
|
</if>
|
30
30
|
</th>
|
31
|
-
</
|
31
|
+
</with-field-names>
|
32
32
|
<th if="&all_parameters[:controls]" class="controls"/>
|
33
|
-
</
|
34
|
-
</
|
33
|
+
</field-heading-row>
|
34
|
+
</table>
|
35
35
|
<else>
|
36
|
-
<do param="
|
36
|
+
<do param="empty-message"/>
|
37
37
|
</else>
|
38
38
|
|
39
39
|
<nav class="page">
|
40
|
-
<
|
40
|
+
<page-nav param/>
|
41
41
|
</nav>
|
42
42
|
</div>
|
43
43
|
</def>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<def tag="
|
1
|
+
<def tag="with-fields" attrs="fields, skip, skip-associations, include-timestamps, force-all"><%
|
2
2
|
field_names = if fields.nil? || fields == "*" || fields.is_a?(Class)
|
3
3
|
klass = fields.is_a?(Class) ? fields : this.class
|
4
4
|
columns = klass.content_columns.every(:name)
|
@@ -18,11 +18,11 @@
|
|
18
18
|
comma_split(fields)
|
19
19
|
end
|
20
20
|
field_names -= comma_split(skip) if skip
|
21
|
-
field_names = field_names.select {|f| can_view?(this, f)}
|
22
|
-
field_names.each do |field| %><with field="&field"><
|
21
|
+
field_names = field_names.select {|f| can_view?(this, f)} unless force_all
|
22
|
+
field_names.each do |field| %><with field="&field"><do param="default"/></with><% end
|
23
23
|
%></def>
|
24
24
|
|
25
|
-
<def tag="
|
25
|
+
<def tag="with-field-names" attrs="fields, skip, skip-associations, include-timestamps"><%=
|
26
26
|
field_names = if fields.nil? || fields == "*" || fields.is_a?(Class)
|
27
27
|
klass = fields.is_a?(Class) ? fields : this.proxy_reflectin.class
|
28
28
|
columns = klass.content_columns.every(:name)
|
@@ -46,7 +46,7 @@
|
|
46
46
|
field_names.map do |n|
|
47
47
|
scope.field_name = n.to_s.gsub("." , "_")
|
48
48
|
scope.field_path = n
|
49
|
-
|
49
|
+
parameters.default
|
50
50
|
end
|
51
51
|
end
|
52
52
|
%>
|
@@ -1,61 +1,70 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
skip = (ENV['SKIP'] || "").split(",")
|
10
|
-
skip << "schema_info"
|
11
|
-
|
12
|
-
sql = 'SELECT * FROM %s'
|
1
|
+
namespace :hobo do
|
2
|
+
|
3
|
+
namespace :fixtures do
|
4
|
+
|
5
|
+
desc 'Dump a database to yaml fixtures. Set environment variables DB'
|
6
|
+
'and DEST to specify the target database and destination path for the'
|
7
|
+
'fixtures. DB defaults to development and DEST defaults to RAILS_ROOT/'
|
8
|
+
'test/fixtures.'
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
task :dump => :environment do
|
11
|
+
path = ENV['DEST'] || "#{RAILS_ROOT}/test/fixtures"
|
12
|
+
db = ENV['RAILS_ENV'] || 'test'
|
13
|
+
|
14
|
+
skip = (ENV['SKIP'] || "").split(",")
|
15
|
+
skip << "schema_info"
|
16
|
+
|
17
|
+
sql = 'SELECT * FROM %s'
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
ActiveRecord::Base.establish_connection(db)
|
20
|
+
ActiveRecord::Base.connection.select_values('show tables').each do |table_name|
|
21
|
+
unless skip.include?(table_name)
|
22
|
+
fixture_file = "#{path}/#{table_name}.yml"
|
23
|
+
old = YAML::load(File.read(fixture_file)) rescue nil
|
24
|
+
|
25
|
+
records = ActiveRecord::Base.connection.select_all(sql % table_name).inject({}) do |hash, record|
|
26
|
+
record.each_pair do |k, v|
|
27
|
+
if v.nil?
|
28
|
+
record.delete(k)
|
29
|
+
elsif (k == "id" or k.ends_with?("_id")) and v =~ /^\d+$/
|
30
|
+
record[k] = v.to_i
|
31
|
+
end
|
32
|
+
end
|
33
|
+
old_pair = old && old.find{|k,v| v["id"] == record["id"]}
|
34
|
+
name = old_pair ? old_pair.first : "#{table_name.singularize}_#{record["id"]}"
|
35
|
+
hash[name] = record
|
36
|
+
hash
|
26
37
|
end
|
27
|
-
|
28
|
-
|
29
|
-
name = old_pair ? old_pair.first : "#{table_name.singularize}_#{record["id"]}"
|
30
|
-
hash[name] = record
|
31
|
-
hash
|
38
|
+
File.open(fixture_file, 'wb') { |file| file.write(records.to_yaml) }
|
39
|
+
end
|
32
40
|
end
|
33
|
-
File.open(fixture_file, 'wb') { |file| file.write(records.to_yaml) }
|
34
41
|
end
|
35
|
-
end
|
36
|
-
end
|
37
42
|
|
38
|
-
# ActiveRecord::Base.connection.select_values('show tables')
|
39
|
-
# is mysql specific
|
40
|
-
# SQLite: ActiveRecord::Base.connection.select_values('.table')
|
41
|
-
# Postgres
|
42
|
-
# table_names = ActiveRecord::Base.connection.select_values(<<-end_sql)
|
43
|
-
# SELECT c.relname
|
44
|
-
# FROM pg_class c
|
45
|
-
# LEFT JOIN pg_roles r ON r.oid = c.relowner
|
46
|
-
# LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
|
47
|
-
# WHERE c.relkind IN ('r','')
|
48
|
-
# AND n.nspname IN ('myappschema', 'public')
|
49
|
-
# AND pg_table_is_visible(c.oid)
|
50
|
-
# end_sql
|
43
|
+
# ActiveRecord::Base.connection.select_values('show tables')
|
44
|
+
# is mysql specific
|
45
|
+
# SQLite: ActiveRecord::Base.connection.select_values('.table')
|
46
|
+
# Postgres
|
47
|
+
# table_names = ActiveRecord::Base.connection.select_values(<<-end_sql)
|
48
|
+
# SELECT c.relname
|
49
|
+
# FROM pg_class c
|
50
|
+
# LEFT JOIN pg_roles r ON r.oid = c.relowner
|
51
|
+
# LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
|
52
|
+
# WHERE c.relkind IN ('r','')
|
53
|
+
# AND n.nspname IN ('myappschema', 'public')
|
54
|
+
# AND pg_table_is_visible(c.oid)
|
55
|
+
# end_sql
|
56
|
+
|
57
|
+
def fixture_name(table, record)
|
58
|
+
model = table.classify.constantize
|
59
|
+
name = if table.in?(FIXTURE_NAMES)
|
60
|
+
obj = model.find(record[model.primary_key])
|
61
|
+
FIXTURE_NAMES[table].call(obj)
|
62
|
+
else
|
63
|
+
record["name"] || record["title"] || "#{table}_#{record[model.primary_key]}"
|
64
|
+
end
|
65
|
+
name.gsub(/\W+/, "_").downcase
|
66
|
+
end
|
51
67
|
|
52
|
-
|
53
|
-
|
54
|
-
name = if table.in?(FIXTURE_NAMES)
|
55
|
-
obj = model.find(record[model.primary_key])
|
56
|
-
FIXTURE_NAMES[table].call(obj)
|
57
|
-
else
|
58
|
-
record["name"] || record["title"] || "#{table}_#{record[model.primary_key]}"
|
59
|
-
end
|
60
|
-
name.gsub(/\W+/, "_").downcase
|
68
|
+
end
|
69
|
+
|
61
70
|
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
require 'ruby-debug'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
def restore_erb_scriptlets(scriptlets, src)
|
5
|
+
src.gsub(/\[!\[HOBO-ERB(\d+)\s*\]!\]/m) {|s| "<%#{scriptlets[$1.to_i]}%>" }
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
def fix_nodes(nodes)
|
10
|
+
nodes.map{|x| fix_element(x) if x.is_a?(REXML::Element) }
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def start_tag_replace(el, repl)
|
15
|
+
i, len = el.source_offset, el.start_tag_source.length
|
16
|
+
@src[i..i+len-1] = repl
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
def classes?
|
21
|
+
ENV['CLASS']
|
22
|
+
end
|
23
|
+
|
24
|
+
def ids?
|
25
|
+
ENV['ID']
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def string_interpolate_safe_dasherize(s)
|
30
|
+
token = "[[MAKE_ME_A_DASH!]]"
|
31
|
+
s.gsub("_", token).
|
32
|
+
gsub(/\#\{.*?\}/) {|s2| s2.gsub(token, "_") }.
|
33
|
+
gsub(token, "-")
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def fix_children(element, template_params)
|
38
|
+
element.elements.to_a.reverse.each do |e|
|
39
|
+
# recurse first - we're going backwards
|
40
|
+
is_template_call = e.dryml_name =~ /^[A-Z]/ && !e.attribute("replace")
|
41
|
+
fix_children(e, is_template_call)
|
42
|
+
|
43
|
+
fixed = fix_element(e, template_params)
|
44
|
+
start_tag_replace(e, fixed)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def fix_element(e, template_param)
|
50
|
+
tag = e.start_tag_source.dup
|
51
|
+
|
52
|
+
if e.dryml_name == "tagbody"
|
53
|
+
tag.sub!("<tagbody", '<do param="default"')
|
54
|
+
elsif e.dryml_name == "default_tagbody"
|
55
|
+
tag.sub!("<default_tagbody", '<param-content')
|
56
|
+
else
|
57
|
+
tag.sub!("<#{e.dryml_name}", "<#{e.dryml_name.underscore.dasherize}#{':' if template_param}")
|
58
|
+
end
|
59
|
+
|
60
|
+
start = e.expanded_name.length+1
|
61
|
+
tag[start..-1] = tag[start..-1].gsub(/([A-Za-z_]+)(\s*=\s*("(.*?)"|'(.*?)'))?/) do |s|
|
62
|
+
_, name, _, value = *Regexp.last_match
|
63
|
+
|
64
|
+
s.sub!(/^#{name}/, name.dasherize)
|
65
|
+
|
66
|
+
if value
|
67
|
+
# underscore / dasherize the values of various attributes
|
68
|
+
|
69
|
+
if e.name == "def" && name.in?(%w(tag attrs alias_of extend_with))
|
70
|
+
s.sub!(/#{Regexp.escape(value)}$/) {|v| v.underscore.dasherize}
|
71
|
+
|
72
|
+
elsif name.in?(%w(part update)) || (classes? && name == 'class') || (ids? && name == 'id')
|
73
|
+
s.sub!(/#{Regexp.escape(value)}$/) {|v| string_interpolate_safe_dasherize(v) }
|
74
|
+
|
75
|
+
elsif name == "param"
|
76
|
+
s.sub!(/#{Regexp.escape(value)}$/) {|v| string_interpolate_safe_dasherize(v.underscore) }
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
s
|
81
|
+
end
|
82
|
+
tag
|
83
|
+
end
|
84
|
+
|
85
|
+
|
86
|
+
def fix_file(filename)
|
87
|
+
puts "Fixing #{filename}"
|
88
|
+
src = File.read(filename)
|
89
|
+
|
90
|
+
# Ripped from Hobo::Dryml::Template - hide erb scriptlets and parse with REXML
|
91
|
+
scriptlets = {}
|
92
|
+
src = src.gsub(/<%(.*?)%>/m) do
|
93
|
+
_, scriptlet = *Regexp.last_match
|
94
|
+
id = scriptlets.size + 1
|
95
|
+
scriptlets[id] = scriptlet
|
96
|
+
newlines = "\n" * scriptlet.count("\n")
|
97
|
+
"[![HOBO-ERB#{id}#{newlines}]!]"
|
98
|
+
end
|
99
|
+
|
100
|
+
# DRYML doesn't have to have a single root - add one to keep REXML
|
101
|
+
# happy
|
102
|
+
@src = "<root>" + src + "</root>"
|
103
|
+
begin
|
104
|
+
doc = REXML::Document.new(Hobo::Dryml::RexSource.new(@src), :dryml_mode => true)
|
105
|
+
rescue REXML::ParseException => e
|
106
|
+
raise Exception, "File: #{@template_path}\n#{e}"
|
107
|
+
end
|
108
|
+
|
109
|
+
fix_children(doc[0], false)
|
110
|
+
|
111
|
+
#Fix close tags
|
112
|
+
@src.gsub!(/<\/[^:>]*/) { |s| s.underscore.dasherize }
|
113
|
+
@src.gsub!(/<\/tagbody\s*>/, "</do>")
|
114
|
+
|
115
|
+
# Strip the root tag we added
|
116
|
+
@src.sub!(/^<root>/, "")
|
117
|
+
@src.sub!(/<\/root>$/, "")
|
118
|
+
|
119
|
+
fixed = restore_erb_scriptlets(scriptlets, @src)
|
120
|
+
File.open(filename, 'w') { |f| f.write(fixed) }
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
namespace :hobo do
|
125
|
+
|
126
|
+
desc "Replace old-style DRYML source code with CamelCaseTags and underscores with new DRYML syntax"
|
127
|
+
task :fixdryml => :environment do
|
128
|
+
|
129
|
+
dir = ENV['DIR']._?.sub(/\/$/, '') || "app/views"
|
130
|
+
|
131
|
+
# Make a backup
|
132
|
+
backup_dir = "#{dir.gsub('../', '').gsub('/', '_')}_before_fixdryml"
|
133
|
+
if File.exist?(backup_dir)
|
134
|
+
puts "Backup (#{backup_dir}) already exists - be careful! (nothing changed)"
|
135
|
+
exit
|
136
|
+
end
|
137
|
+
FileUtils.cp_r(dir, backup_dir)
|
138
|
+
|
139
|
+
Dir["#{dir}/**/*.dryml"].each do |f|
|
140
|
+
fix_file(f)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: hobo
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.7.0
|
7
|
+
date: 2007-12-03 00:00:00 +00:00
|
8
8
|
summary: The web app builder for Rails
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -68,44 +68,54 @@ files:
|
|
68
68
|
- hobo_files/plugin/generators/hobo_rapid
|
69
69
|
- hobo_files/plugin/generators/hobo_rapid/hobo_rapid_generator.rb
|
70
70
|
- hobo_files/plugin/generators/hobo_rapid/templates
|
71
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/
|
72
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/
|
73
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.js
|
71
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/hobo-rapid.css
|
72
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/hobo-rapid.js
|
74
73
|
- hobo_files/plugin/generators/hobo_rapid/templates/lowpro.js
|
74
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/reset.css
|
75
75
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes
|
76
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean
|
77
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public
|
78
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images
|
79
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/pencil.png
|
80
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/small_close.png
|
81
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets
|
82
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/application.css
|
83
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid_ui.css
|
84
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/views
|
85
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/views/application.dryml
|
76
86
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default
|
77
87
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public
|
78
88
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images
|
79
89
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/banner.gif
|
80
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
81
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
82
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
83
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
84
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
85
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
86
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
87
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
88
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
89
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
90
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
91
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
92
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
93
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
90
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-bodytop.gif
|
91
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-01.gif
|
92
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-02.gif
|
93
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-03.gif
|
94
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-corner-04.gif
|
95
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-bottom.gif
|
96
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-left.gif
|
97
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-right.gif
|
98
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/bkg-shadow-top.gif
|
99
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header-blue.gif
|
100
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header-dblue.gif
|
101
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header-green.gif
|
102
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header-purple.gif
|
103
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/header-red.gif
|
94
104
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/logo.gif
|
95
105
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/plus.png
|
96
106
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/spinner.gif
|
97
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
98
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
99
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
100
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
101
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
102
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
103
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
104
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
105
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
106
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
107
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
108
|
-
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/
|
107
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-dblue.gif
|
108
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-green.gif
|
109
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-purple.gif
|
110
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/txt-list-img-red.gif
|
111
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-corner-01.gif
|
112
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-corner-02.gif
|
113
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-corner-03.gif
|
114
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-corner-04.gif
|
115
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-shadow-bottom.gif
|
116
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-shadow-left.gif
|
117
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-shadow-right.gif
|
118
|
+
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/window-shadow-top.gif
|
109
119
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets
|
110
120
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css
|
111
121
|
- hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views
|
@@ -144,7 +154,7 @@ files:
|
|
144
154
|
- hobo_files/plugin/lib/hobo/dryml/dryml_builder.rb
|
145
155
|
- hobo_files/plugin/lib/hobo/dryml/part_context.rb
|
146
156
|
- hobo_files/plugin/lib/hobo/dryml/scoped_variables.rb
|
147
|
-
- hobo_files/plugin/lib/hobo/dryml/
|
157
|
+
- hobo_files/plugin/lib/hobo/dryml/tag_parameters.rb
|
148
158
|
- hobo_files/plugin/lib/hobo/dryml/taglib.rb
|
149
159
|
- hobo_files/plugin/lib/hobo/dryml/template.rb
|
150
160
|
- hobo_files/plugin/lib/hobo/dryml/template_environment.rb
|
@@ -198,6 +208,7 @@ files:
|
|
198
208
|
- hobo_files/plugin/tasks
|
199
209
|
- hobo_files/plugin/tasks/dump_fixtures.rake
|
200
210
|
- hobo_files/plugin/tasks/environments.rake
|
211
|
+
- hobo_files/plugin/tasks/fix_dryml.rake
|
201
212
|
- hobo_files/plugin/tasks/hobo_tasks.rake
|
202
213
|
- hobo_files/plugin/uninstall.rb
|
203
214
|
- bin/hobo
|