tdreyno-staticmatic 2.1.0 → 2.1.1

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.
Files changed (64) hide show
  1. data/bin/staticmatic +2 -14
  2. data/lib/staticmatic/actionpack_support/remove_controller_caching.rb +7 -0
  3. data/lib/staticmatic/autoload.rb +16 -14
  4. data/lib/staticmatic/base.rb +97 -126
  5. data/lib/staticmatic/builder.rb +64 -86
  6. data/lib/staticmatic/config.rb +31 -37
  7. data/lib/staticmatic/previewer.rb +16 -28
  8. data/lib/staticmatic/template_handlers/haml.rb +6 -10
  9. data/lib/staticmatic/template_handlers/liquid.rb +3 -7
  10. data/lib/staticmatic/template_handlers/markdown.rb +3 -7
  11. data/lib/staticmatic/template_handlers/sass.rb +3 -7
  12. data/lib/staticmatic/template_handlers/textile.rb +3 -7
  13. data/lib/staticmatic.rb +16 -12
  14. data/lib/templates/script/builder +6 -0
  15. data/lib/templates/script/server +4 -0
  16. data/spec/action_view_helpers_spec.rb +12 -0
  17. data/spec/asset_helpers_spec.rb +22 -0
  18. data/spec/base_spec.rb +42 -0
  19. data/spec/builder_spec.rb +44 -0
  20. data/spec/config_spec.rb +31 -0
  21. data/spec/deprecation_spec.rb +18 -0
  22. data/spec/fixtures/sample/Rakefile +4 -0
  23. data/spec/fixtures/sample/build/haml_test.html +11 -0
  24. data/spec/fixtures/sample/build/hello_world.html +9 -0
  25. data/spec/fixtures/sample/build/index.html +9 -0
  26. data/spec/fixtures/sample/build/page_with_error.html +61 -0
  27. data/spec/fixtures/sample/build/services/index.html +9 -0
  28. data/spec/fixtures/sample/build/services/web_development.html +9 -0
  29. data/spec/fixtures/sample/build/stylesheets/site.css +3 -0
  30. data/spec/fixtures/sample/config.rb +3 -0
  31. data/spec/fixtures/sample/src/helpers/speech_helper.rb +5 -0
  32. data/spec/fixtures/sample/src/layouts/site.html.erb +9 -0
  33. data/spec/fixtures/sample/src/layouts/specified_layout.html.erb +3 -0
  34. data/spec/fixtures/sample/src/pages/_form.html.erb +1 -0
  35. data/spec/fixtures/sample/src/pages/haml_test.html.haml +3 -0
  36. data/spec/fixtures/sample/src/pages/hello_world.html.erb +1 -0
  37. data/spec/fixtures/sample/src/pages/index.html.erb +1 -0
  38. data/spec/fixtures/sample/src/pages/liquid_test.html.liquid +3 -0
  39. data/spec/fixtures/sample/src/pages/markdown_test.html.markdown +3 -0
  40. data/spec/fixtures/sample/src/pages/page_with_error.html.haml +3 -0
  41. data/spec/fixtures/sample/src/pages/services/index.html.erb +1 -0
  42. data/spec/fixtures/sample/src/pages/services/web_development.html.erb +1 -0
  43. data/spec/fixtures/sample/src/pages/specify_layout.html.erb +1 -0
  44. data/spec/fixtures/sample/src/pages/textile_test.html.textile +3 -0
  45. data/spec/fixtures/sample/src/stylesheets/site.css.sass +3 -0
  46. data/spec/layouts_spec.rb +29 -0
  47. data/spec/rendering_spec.rb +83 -0
  48. metadata +78 -22
  49. data/Rakefile +0 -12
  50. data/app_generators/staticmatic/staticmatic_generator.rb +0 -74
  51. data/app_generators/staticmatic/templates/Rakefile +0 -3
  52. data/lib/staticmatic/rescue.rb +0 -14
  53. data/lib/tasks/staticmatic.rb +0 -9
  54. data/staticmatic.gemspec +0 -52
  55. data/vendor/html-scanner/html/document.rb +0 -68
  56. data/vendor/html-scanner/html/node.rb +0 -530
  57. data/vendor/html-scanner/html/sanitizer.rb +0 -173
  58. data/vendor/html-scanner/html/selector.rb +0 -828
  59. data/vendor/html-scanner/html/tokenizer.rb +0 -105
  60. data/vendor/html-scanner/html/version.rb +0 -11
  61. /data/{app_generators/staticmatic → lib}/templates/src/helpers/site_helper.rb +0 -0
  62. /data/{app_generators/staticmatic → lib}/templates/src/layouts/site.html.haml +0 -0
  63. /data/{app_generators/staticmatic → lib}/templates/src/pages/index.html.haml +0 -0
  64. /data/{app_generators/staticmatic → lib}/templates/src/stylesheets/site.css.sass +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdreyno-staticmatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Bartholomew
@@ -10,17 +10,17 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-08-15 00:00:00 -07:00
14
- default_executable:
13
+ date: 2008-09-05 00:00:00 -07:00
14
+ default_executable: staticmatic
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: rubigen
17
+ name: templater
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0"
23
+ version: 0.3.3
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mongrel
@@ -68,14 +68,6 @@ extra_rdoc_files: []
68
68
 
69
69
  files:
70
70
  - LICENSE
71
- - Rakefile
72
- - staticmatic.gemspec
73
- - app_generators/staticmatic/staticmatic_generator.rb
74
- - app_generators/staticmatic/templates/Rakefile
75
- - app_generators/staticmatic/templates/src/helpers/site_helper.rb
76
- - app_generators/staticmatic/templates/src/layouts/site.html.haml
77
- - app_generators/staticmatic/templates/src/pages/index.html.haml
78
- - app_generators/staticmatic/templates/src/stylesheets/site.css.sass
79
71
  - bin/staticmatic
80
72
  - lib/staticmatic.rb
81
73
  - lib/staticmatic/autoload.rb
@@ -83,10 +75,12 @@ files:
83
75
  - lib/staticmatic/builder.rb
84
76
  - lib/staticmatic/config.rb
85
77
  - lib/staticmatic/deprecation.rb
78
+ - lib/staticmatic/generators.rb
86
79
  - lib/staticmatic/previewer.rb
87
80
  - lib/staticmatic/rescue.rb
88
81
  - lib/staticmatic/actionpack_support/mime.rb
89
82
  - lib/staticmatic/actionpack_support/remove_partial_benchmark.rb
83
+ - lib/staticmatic/actionpack_support/remove_controller_caching.rb
90
84
  - lib/staticmatic/helpers/asset_tag_helper.rb
91
85
  - lib/staticmatic/helpers/page_helper.rb
92
86
  - lib/staticmatic/helpers/url_helper.rb
@@ -97,13 +91,44 @@ files:
97
91
  - lib/staticmatic/template_handlers/textile.rb
98
92
  - lib/staticmatic/templates/rescues/default_error.html.erb
99
93
  - lib/staticmatic/templates/rescues/template_error.html.erb
100
- - lib/tasks/staticmatic.rb
101
- - vendor/html-scanner/html/document.rb
102
- - vendor/html-scanner/html/node.rb
103
- - vendor/html-scanner/html/sanitizer.rb
104
- - vendor/html-scanner/html/selector.rb
105
- - vendor/html-scanner/html/tokenizer.rb
106
- - vendor/html-scanner/html/version.rb
94
+ - lib/templates/script/server
95
+ - lib/templates/script/builder
96
+ - lib/templates/src/helpers/site_helper.rb
97
+ - lib/templates/src/layouts/site.html.haml
98
+ - lib/templates/src/pages/index.html.haml
99
+ - lib/templates/src/stylesheets/site.css.sass
100
+ - spec/action_view_helpers_spec.rb
101
+ - spec/asset_helpers_spec.rb
102
+ - spec/base_spec.rb
103
+ - spec/builder_spec.rb
104
+ - spec/config_spec.rb
105
+ - spec/deprecation_spec.rb
106
+ - spec/layouts_spec.rb
107
+ - spec/rendering_spec.rb
108
+ - spec/fixtures/sample/Rakefile
109
+ - spec/fixtures/sample/config.rb
110
+ - spec/fixtures/sample/build/haml_test.html
111
+ - spec/fixtures/sample/build/hello_world.html
112
+ - spec/fixtures/sample/build/index.html
113
+ - spec/fixtures/sample/build/page_with_error.html
114
+ - spec/fixtures/sample/build/services/index.html
115
+ - spec/fixtures/sample/build/services/web_development.html
116
+ - spec/fixtures/sample/build/stylesheets/site.css
117
+ - spec/fixtures/sample/src/helpers/speech_helper.rb
118
+ - spec/fixtures/sample/src/layouts/site.html.erb
119
+ - spec/fixtures/sample/src/layouts/specified_layout.html.erb
120
+ - spec/fixtures/sample/src/pages/_form.html.erb
121
+ - spec/fixtures/sample/src/pages/haml_test.html.haml
122
+ - spec/fixtures/sample/src/pages/hello_world.html.erb
123
+ - spec/fixtures/sample/src/pages/index.html.erb
124
+ - spec/fixtures/sample/src/pages/liquid_test.html.liquid
125
+ - spec/fixtures/sample/src/pages/markdown_test.html.markdown
126
+ - spec/fixtures/sample/src/pages/page_with_error.html.haml
127
+ - spec/fixtures/sample/src/pages/specify_layout.html.erb
128
+ - spec/fixtures/sample/src/pages/textile_test.html.textile
129
+ - spec/fixtures/sample/src/pages/services/index.html.erb
130
+ - spec/fixtures/sample/src/pages/services/web_development.html.erb
131
+ - spec/fixtures/sample/src/stylesheets/site.css.sass
107
132
  has_rdoc: false
108
133
  homepage: http://github.com/tdreyno/staticmatic
109
134
  post_install_message:
@@ -130,5 +155,36 @@ rubygems_version: 1.2.0
130
155
  signing_key:
131
156
  specification_version: 2
132
157
  summary: Static sites, the Rails Way
133
- test_files: []
134
-
158
+ test_files:
159
+ - spec/action_view_helpers_spec.rb
160
+ - spec/asset_helpers_spec.rb
161
+ - spec/base_spec.rb
162
+ - spec/builder_spec.rb
163
+ - spec/config_spec.rb
164
+ - spec/deprecation_spec.rb
165
+ - spec/layouts_spec.rb
166
+ - spec/rendering_spec.rb
167
+ - spec/fixtures/sample/Rakefile
168
+ - spec/fixtures/sample/config.rb
169
+ - spec/fixtures/sample/build/haml_test.html
170
+ - spec/fixtures/sample/build/hello_world.html
171
+ - spec/fixtures/sample/build/index.html
172
+ - spec/fixtures/sample/build/page_with_error.html
173
+ - spec/fixtures/sample/build/services/index.html
174
+ - spec/fixtures/sample/build/services/web_development.html
175
+ - spec/fixtures/sample/build/stylesheets/site.css
176
+ - spec/fixtures/sample/src/helpers/speech_helper.rb
177
+ - spec/fixtures/sample/src/layouts/site.html.erb
178
+ - spec/fixtures/sample/src/layouts/specified_layout.html.erb
179
+ - spec/fixtures/sample/src/pages/_form.html.erb
180
+ - spec/fixtures/sample/src/pages/haml_test.html.haml
181
+ - spec/fixtures/sample/src/pages/hello_world.html.erb
182
+ - spec/fixtures/sample/src/pages/index.html.erb
183
+ - spec/fixtures/sample/src/pages/liquid_test.html.liquid
184
+ - spec/fixtures/sample/src/pages/markdown_test.html.markdown
185
+ - spec/fixtures/sample/src/pages/page_with_error.html.haml
186
+ - spec/fixtures/sample/src/pages/specify_layout.html.erb
187
+ - spec/fixtures/sample/src/pages/textile_test.html.textile
188
+ - spec/fixtures/sample/src/pages/services/index.html.erb
189
+ - spec/fixtures/sample/src/pages/services/web_development.html.erb
190
+ - spec/fixtures/sample/src/stylesheets/site.css.sass
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- require 'rake'
2
- require 'rubygems'
3
- require 'spec'
4
- require 'spec/rake/spectask'
5
-
6
- task :default => :spec
7
-
8
- desc "Run all specs in spec directory (excluding plugin specs)"
9
-
10
- Spec::Rake::SpecTask.new(:spec) do |t|
11
- t.spec_files = FileList['spec/**/*_spec.rb']
12
- end
@@ -1,74 +0,0 @@
1
- class StaticmaticGenerator < RubiGen::Base
2
-
3
- DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
4
- Config::CONFIG['ruby_install_name'])
5
-
6
- default_options :template => nil
7
-
8
- attr_reader :name
9
-
10
- def initialize(runtime_args, runtime_options = {})
11
- super
12
- usage if args.empty?
13
- @destination_root = File.expand_path(args.shift)
14
- @name = base_name
15
- extract_options
16
- end
17
-
18
- def manifest
19
- record do |m|
20
- # Ensure appropriate folder(s) exists
21
- m.directory ''
22
-
23
- # Create stubs
24
- m.file_copy_each ["Rakefile"]
25
- BASEDIRS.each do |path|
26
- m.directory path
27
- m.folder path, path
28
- end
29
-
30
- # m.template "template.rb", "some_file_after_erb.rb"
31
- # m.template_copy_each ["Rakefile"]
32
- # m.file "file", "some_file_copied"
33
-
34
- # Rubigen script/generate
35
- # m.dependency "install_rubigen_scripts", [destination_root, 'staticmatic'],
36
- # :shebang => options[:shebang], :collision => :force
37
- end
38
- end
39
-
40
- protected
41
- def banner
42
- <<-EOS
43
- Creates a scaffold for building a staticmatic website
44
- USAGE: #{spec.name} name
45
-
46
- EOS
47
- end
48
-
49
- def add_options!(opts)
50
- opts.separator ''
51
- opts.separator 'Options:'
52
- # For each option below, place the default
53
- # at the top of the file next to "default_options"
54
- opts.on("-t", "--template=\"Your Template Directory\"", String,
55
- "Use a custom template for this project") { |options[:template]| }
56
- opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
57
- end
58
-
59
- def extract_options
60
- # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
61
- # Templates can access these value via the attr_reader-generated methods, but not the
62
- # raw instance variable value.
63
- @source_root = File.expand_path(options[:template]) if options[:template]
64
- end
65
-
66
- # Installation skeleton. Intermediate directories are automatically
67
- # created so don't sweat their absence here.
68
- BASEDIRS = %w(
69
- src/helpers
70
- src/layouts
71
- src/pages
72
- src/stylesheets
73
- )
74
- end
@@ -1,3 +0,0 @@
1
- require 'rake'
2
- require 'rubygems'
3
- require 'tasks/staticmatic'
@@ -1,14 +0,0 @@
1
- module StaticMatic
2
- module Rescue
3
- # Render an error template for the given exception
4
- def rescue_from_error(exception)
5
- rescue_template = (exception == ActionView::TemplateError) ?
6
- "template_error" :
7
- "default_error"
8
-
9
- error_template_path = File.expand_path(File.dirname(__FILE__) + "/templates/rescues/#{rescue_template}.html.erb")
10
- @template.instance_variable_set("@exception", exception)
11
- @template.render_file(error_template_path, false)
12
- end
13
- end
14
- end
@@ -1,9 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", "staticmatic")
2
-
3
- task :build do
4
- StaticMatic::Builder.build(".")
5
- end
6
-
7
- task :preview do
8
- StaticMatic::Previewer.start(".")
9
- end
data/staticmatic.gemspec DELETED
@@ -1,52 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = "staticmatic"
3
- s.version = "2.1.0"
4
- s.date = "2008-08-15"
5
- s.authors = ["Stephen Bartholomew", "Thomas Reynolds"]
6
- s.email = "tdreyno@gmail.com"
7
- s.homepage = "http://github.com/tdreyno/staticmatic"
8
- s.summary = "Static sites, the Rails Way"
9
- s.files = ["LICENSE",
10
- "Rakefile",
11
- "staticmatic.gemspec",
12
- "app_generators/staticmatic/staticmatic_generator.rb",
13
- "app_generators/staticmatic/templates/Rakefile",
14
- "app_generators/staticmatic/templates/src/helpers/site_helper.rb",
15
- "app_generators/staticmatic/templates/src/layouts/site.html.haml",
16
- "app_generators/staticmatic/templates/src/pages/index.html.haml",
17
- "app_generators/staticmatic/templates/src/stylesheets/site.css.sass",
18
- "bin/staticmatic",
19
- "lib/staticmatic.rb",
20
- "lib/staticmatic/autoload.rb",
21
- "lib/staticmatic/base.rb",
22
- "lib/staticmatic/builder.rb",
23
- "lib/staticmatic/config.rb",
24
- "lib/staticmatic/deprecation.rb",
25
- "lib/staticmatic/previewer.rb",
26
- "lib/staticmatic/rescue.rb",
27
- "lib/staticmatic/actionpack_support/mime.rb",
28
- "lib/staticmatic/actionpack_support/remove_partial_benchmark.rb",
29
- "lib/staticmatic/helpers/asset_tag_helper.rb",
30
- "lib/staticmatic/helpers/page_helper.rb",
31
- "lib/staticmatic/helpers/url_helper.rb",
32
- "lib/staticmatic/template_handlers/haml.rb",
33
- "lib/staticmatic/template_handlers/liquid.rb",
34
- "lib/staticmatic/template_handlers/markdown.rb",
35
- "lib/staticmatic/template_handlers/sass.rb",
36
- "lib/staticmatic/template_handlers/textile.rb",
37
- "lib/staticmatic/templates/rescues/default_error.html.erb",
38
- "lib/staticmatic/templates/rescues/template_error.html.erb",
39
- "lib/tasks/staticmatic.rb",
40
- "vendor/html-scanner/html/document.rb",
41
- "vendor/html-scanner/html/node.rb",
42
- "vendor/html-scanner/html/sanitizer.rb",
43
- "vendor/html-scanner/html/selector.rb",
44
- "vendor/html-scanner/html/tokenizer.rb",
45
- "vendor/html-scanner/html/version.rb"]
46
- s.executables = %w(staticmatic)
47
- s.add_dependency("rubigen")
48
- s.add_dependency("mongrel")
49
- s.add_dependency("haml", ">=2.0.1")
50
- s.add_dependency("actionpack", ">=2.1.0")
51
- s.add_dependency("activesupport", ">=2.1.0")
52
- end
@@ -1,68 +0,0 @@
1
- require 'html/tokenizer'
2
- require 'html/node'
3
- require 'html/selector'
4
- require 'html/sanitizer'
5
-
6
- module HTML #:nodoc:
7
- # A top-level HTMl document. You give it a body of text, and it will parse that
8
- # text into a tree of nodes.
9
- class Document #:nodoc:
10
-
11
- # The root of the parsed document.
12
- attr_reader :root
13
-
14
- # Create a new Document from the given text.
15
- def initialize(text, strict=false, xml=false)
16
- tokenizer = Tokenizer.new(text)
17
- @root = Node.new(nil)
18
- node_stack = [ @root ]
19
- while token = tokenizer.next
20
- node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token)
21
-
22
- node_stack.last.children << node unless node.tag? && node.closing == :close
23
- if node.tag?
24
- if node_stack.length > 1 && node.closing == :close
25
- if node_stack.last.name == node.name
26
- if node_stack.last.children.empty?
27
- node_stack.last.children << Text.new(node_stack.last, node.line, node.position, "")
28
- end
29
- node_stack.pop
30
- else
31
- open_start = node_stack.last.position - 20
32
- open_start = 0 if open_start < 0
33
- close_start = node.position - 20
34
- close_start = 0 if close_start < 0
35
- msg = <<EOF.strip
36
- ignoring attempt to close #{node_stack.last.name} with #{node.name}
37
- opened at byte #{node_stack.last.position}, line #{node_stack.last.line}
38
- closed at byte #{node.position}, line #{node.line}
39
- attributes at open: #{node_stack.last.attributes.inspect}
40
- text around open: #{text[open_start,40].inspect}
41
- text around close: #{text[close_start,40].inspect}
42
- EOF
43
- strict ? raise(msg) : warn(msg)
44
- end
45
- elsif !node.childless?(xml) && node.closing != :close
46
- node_stack.push node
47
- end
48
- end
49
- end
50
- end
51
-
52
- # Search the tree for (and return) the first node that matches the given
53
- # conditions. The conditions are interpreted differently for different node
54
- # types, see HTML::Text#find and HTML::Tag#find.
55
- def find(conditions)
56
- @root.find(conditions)
57
- end
58
-
59
- # Search the tree for (and return) all nodes that match the given
60
- # conditions. The conditions are interpreted differently for different node
61
- # types, see HTML::Text#find and HTML::Tag#find.
62
- def find_all(conditions)
63
- @root.find_all(conditions)
64
- end
65
-
66
- end
67
-
68
- end