awestruct 0.5.7 → 0.6.0.RC1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE.txt +14 -11
  4. data/README.md +13 -4
  5. data/awestruct.gemspec +19 -20
  6. data/lib/awestruct/cli/invoker.rb +4 -2
  7. data/lib/awestruct/cli/manifest.rb +1 -2
  8. data/lib/awestruct/cli/options.rb +2 -1
  9. data/lib/awestruct/config.rb +5 -0
  10. data/lib/awestruct/config/default-site.yml +1 -2
  11. data/lib/awestruct/context_helper.rb +2 -2
  12. data/lib/awestruct/engine.rb +43 -41
  13. data/lib/awestruct/extensions/partial.rb +14 -12
  14. data/lib/awestruct/extensions/posts.rb +2 -2
  15. data/lib/awestruct/extensions/sitemap.rb +2 -2
  16. data/lib/awestruct/handlers/base_handler.rb +4 -2
  17. data/lib/awestruct/handlers/base_tilt_handler.rb +3 -4
  18. data/lib/awestruct/handlers/file_handler.rb +4 -1
  19. data/lib/awestruct/handlers/javascript_handler.rb +2 -2
  20. data/lib/awestruct/handlers/redirect_handler.rb +1 -1
  21. data/lib/awestruct/handlers/template/asciidoc.rb +4 -1
  22. data/lib/awestruct/page_loader.rb +5 -5
  23. data/lib/awestruct/pipeline.rb +5 -5
  24. data/lib/awestruct/version.rb +1 -1
  25. data/spec/awestruct/engine_spec.rb +29 -1
  26. data/spec/awestruct/handlers/haml_handler_spec.rb +2 -2
  27. data/spec/awestruct/handlers/page_delegating_handler_spec.rb +5 -11
  28. data/spec/awestruct/handlers/tilt_handler_spec.rb +1 -0
  29. data/spec/support/test-data/engine-generate-syntax-errors/_config/site.yml +26 -0
  30. data/spec/support/test-data/engine-generate-syntax-errors/_ext/pipeline.rb +8 -0
  31. data/spec/support/test-data/engine-generate-syntax-errors/_layouts/base.html.slim +6 -0
  32. data/spec/support/test-data/engine-generate-syntax-errors/index.html.slim +7 -0
  33. metadata +40 -73
  34. data/lib/awestruct/compass/default_configuration.rb +0 -131
@@ -1,131 +0,0 @@
1
- require 'compass'
2
-
3
- module Awestruct
4
- module Compass
5
- class DefaultConfiguration < ::Compass::Configuration::Data
6
-
7
- attr_reader :site
8
-
9
- def initialize site
10
- @site = site
11
- end
12
-
13
- def default_project_type
14
- :stand_alone
15
- end
16
-
17
- def default_environment
18
- site.profile
19
- end
20
-
21
- def default_project_path
22
- site.config.dir
23
- end
24
-
25
- def default_sass_dir
26
- File.join site.config.dir, 'stylesheets'
27
- end
28
-
29
- def default_http_path
30
- site.base_url
31
- end
32
-
33
- def default_css_dir
34
- File.join site.output_dir, 'stylesheets'
35
- end
36
-
37
- def default_javascripts_dir
38
- File.join site.config.dir, 'javascripts'
39
- end
40
-
41
- def default_http_javascripts_dir
42
- File.join http_path, 'javascripts'
43
- end
44
-
45
- def default_http_stylesheets_dir
46
- File.join http_path, 'stylesheets'
47
- end
48
-
49
- def default_images_dir
50
- File.join site.config.dir, 'images'
51
- end
52
-
53
- def default_generated_images_dir
54
- File.join site.output_dir, 'images'
55
- end
56
-
57
- def default_http_generated_images_dir
58
- File.join http_path, 'images'
59
- end
60
-
61
- def default_sprite_load_path
62
- [images_path]
63
- end
64
-
65
- def default_images_path
66
- File.join project_path, 'images'
67
- end
68
-
69
- def default_http_images_dir
70
- File.join http_path, 'images'
71
- end
72
-
73
- def default_fonts_dir
74
- File.join site.config.dir, 'fonts'
75
- end
76
-
77
- def default_http_fonts_dir
78
- File.join http_path, 'fonts'
79
- end
80
-
81
- def line_comments
82
- if self.inherited_data && self.inherited_data.is_a?(::Compass::Configuration::FileData)
83
- return self.inherited_data.line_comments
84
- end
85
- if site.profile.eql? 'production'
86
- return false
87
- else
88
- if site.key? :compass_line_comments
89
- return site.compass_line_comments
90
- end
91
- if site.key?(:scss) && site.scss.key?(:line_comments)
92
- return site.scss.line_comments
93
- end
94
- if site.key?(:sass) && site.sass.key?(:line_comments)
95
- return site.sass.line_comments
96
- end
97
- true
98
- end
99
- end
100
-
101
- def output_style
102
- if self.inherited_data && self.inherited_data.is_a?(::Compass::Configuration::FileData)
103
- return self.inherited_data.output_style
104
- end
105
- if site.profile.eql? 'production'
106
- return :compressed
107
- else
108
- if site.key? :compass_output_style
109
- return site.compass_output_style
110
- end
111
- if (site.key? :scss) && (site.scss.key? :style)
112
- return site.scss.style
113
- end
114
- if (site.key? :sass) && (site.sass.key? :style)
115
- return site.sass.style
116
- end
117
- end
118
- :expanded
119
- end
120
-
121
- def default_relative_assets
122
- false
123
- end
124
-
125
- def default_cache_dir
126
- File.join site.config.dir, '.sass-cache'
127
- end
128
- end
129
- end
130
- end
131
-