awestruct 0.5.4.rc3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +24 -20
- data/LICENSE.txt +4 -4
- data/README.md +5 -5
- data/awestruct.gemspec +14 -11
- data/lib/awestruct/astruct_mixin.rb +0 -1
- data/lib/awestruct/cli/auto.rb +38 -11
- data/lib/awestruct/cli/invoker.rb +55 -39
- data/lib/awestruct/cli/options.rb +32 -22
- data/lib/awestruct/compass/default_configuration.rb +108 -0
- data/lib/awestruct/config.rb +11 -10
- data/lib/awestruct/config/default-site.yml +1 -0
- data/lib/awestruct/context.rb +0 -1
- data/lib/awestruct/dependencies.rb +7 -9
- data/lib/awestruct/deploy/base_deploy.rb +6 -0
- data/lib/awestruct/deploy/github_pages_deploy.rb +1 -0
- data/lib/awestruct/deploy/rsync_deploy.rb +11 -7
- data/lib/awestruct/deployers.rb +0 -1
- data/lib/awestruct/engine.rb +41 -37
- data/lib/awestruct/extensions/cachebuster.rb +2 -2
- data/lib/awestruct/extensions/google_analytics.rb +57 -17
- data/lib/awestruct/extensions/minify.rb +4 -5
- data/lib/awestruct/extensions/obfuscate.rb +13 -3
- data/lib/awestruct/extensions/partial.rb +8 -1
- data/lib/awestruct/extensions/pipeline.rb +11 -6
- data/lib/awestruct/extensions/remotePartial.rb +1 -1
- data/lib/awestruct/extensions/sitemap.rb +5 -1
- data/lib/awestruct/frameworks/base_Gemfile +10 -7
- data/lib/awestruct/frameworks/base_Rakefile +5 -1
- data/lib/awestruct/handler_chain.rb +0 -1
- data/lib/awestruct/handler_chains.rb +5 -1
- data/lib/awestruct/handlers/asciidoctor_handler.rb +9 -22
- data/lib/awestruct/handlers/base_tilt_handler.rb +13 -8
- data/lib/awestruct/handlers/css_tilt_handler.rb +2 -1
- data/lib/awestruct/handlers/front_matter_handler.rb +1 -0
- data/lib/awestruct/handlers/interpolation_handler.rb +1 -1
- data/lib/awestruct/handlers/javascript_handler.rb +1 -2
- data/lib/awestruct/handlers/layout_handler.rb +3 -4
- data/lib/awestruct/handlers/no_op_handler.rb +0 -1
- data/lib/awestruct/handlers/page_delegating_handler.rb +0 -1
- data/lib/awestruct/handlers/template/asciidoc.rb +51 -47
- data/lib/awestruct/handlers/tilt_handler.rb +13 -6
- data/lib/awestruct/handlers/yaml_handler.rb +0 -1
- data/lib/awestruct/layouts.rb +1 -3
- data/lib/awestruct/logger.rb +10 -3
- data/lib/awestruct/page.rb +0 -1
- data/lib/awestruct/page_loader.rb +0 -2
- data/lib/awestruct/pipeline.rb +1 -1
- data/lib/awestruct/site.rb +0 -1
- data/lib/awestruct/util/exception_helper.rb +18 -6
- data/lib/awestruct/version.rb +1 -1
- data/man/awestruct.adoc +1 -1
- data/spec/{astruct_spec.rb → awestruct/astruct_spec.rb} +0 -0
- data/spec/{invoker_spec.rb → awestruct/cli/invoker_spec.rb} +6 -6
- data/spec/{options_spec.rb → awestruct/cli/options_spec.rb} +0 -0
- data/spec/awestruct/deploy/base_deploy_spec.rb +30 -0
- data/spec/{deploy_spec.rb → awestruct/deploy/deploy_spec.rb} +14 -11
- data/spec/{github_pages_deploy_spec.rb → awestruct/deploy/github_pages_deploy_spec.rb} +8 -7
- data/spec/{rsync_deploy_spec.rb → awestruct/deploy/rsync_deploy_spec.rb} +0 -0
- data/spec/{asciidoc_handler_spec.rb → awestruct/handlers/asciidoc_handler_spec.rb} +2 -3
- data/spec/{coffeescript_handler_spec.rb → awestruct/handlers/coffeescript_handler_spec.rb} +0 -0
- data/spec/{erb_handler_spec.rb → awestruct/handlers/erb_handler_spec.rb} +0 -0
- data/spec/{file_handler_spec.rb → awestruct/handlers/file_handler_spec.rb} +7 -7
- data/spec/{front_matter_handler_spec.rb → awestruct/handlers/front_matter_handler_spec.rb} +1 -1
- data/spec/{haml_handler_spec.rb → awestruct/handlers/haml_handler_spec.rb} +0 -0
- data/spec/{interpolation_handler_spec.rb → awestruct/handlers/interpolation_handler_spec.rb} +1 -1
- data/spec/{javascript_handler_spec.rb → awestruct/handlers/javascript_handler_spec.rb} +0 -0
- data/spec/{layout_handler_spec.rb → awestruct/handlers/layout_handler_spec.rb} +1 -1
- data/spec/{less_handler_spec.rb → awestruct/handlers/less_handler_spec.rb} +0 -0
- data/spec/{markdown_handler_spec.rb → awestruct/handlers/markdown_handler_spec.rb} +0 -0
- data/spec/{mustache_handler_spec.rb → awestruct/handlers/mustache_handler_spec.rb} +1 -0
- data/spec/{orgmode_handler_spec.rb → awestruct/handlers/orgmode_handler_spec.rb} +0 -0
- data/spec/{page_delegating_handler_spec.rb → awestruct/handlers/page_delegating_handler_spec.rb} +1 -1
- data/spec/{redirect_handler_spec.rb → awestruct/handlers/redirect_handler_spec.rb} +0 -0
- data/spec/{restructuredtext_handler_spec.rb → awestruct/handlers/restructuredtext_handler_spec.rb} +0 -0
- data/spec/{sass_handler_spec.rb → awestruct/handlers/sass_handler_spec.rb} +0 -0
- data/spec/{scss_handler_spec.rb → awestruct/handlers/scss_handler_spec.rb} +0 -0
- data/spec/{slim_handler_spec.rb → awestruct/handlers/slim_handler_spec.rb} +0 -0
- data/spec/{textile_handler_spec.rb → awestruct/handlers/textile_handler_spec.rb} +1 -0
- data/spec/{tilt_handler_spec.rb → awestruct/handlers/tilt_handler_spec.rb} +6 -8
- data/spec/{yaml_handler_spec.rb → awestruct/handlers/yaml_handler_spec.rb} +1 -1
- data/spec/config_spec.rb +3 -3
- data/spec/engine_spec.rb +30 -43
- data/spec/layouts_spec.rb +1 -1
- data/spec/minify_spec.rb +10 -10
- data/spec/page_loader_spec.rb +1 -1
- data/spec/page_loader_spec_for_layouts.rb +1 -1
- data/spec/page_spec.rb +1 -1
- data/spec/posts_archive_spec.rb +7 -7
- data/spec/server_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -13
- data/spec/support/awestruct_setup.rb +30 -0
- data/spec/support/emmet_matchers.rb +4 -0
- data/spec/support/nokogiri_matchers.rb +4 -0
- data/spec/support/shared_handler_example.rb +1 -1
- data/spec/support/test-config/_config/site.yml +1 -0
- data/spec/{test-data → support/test-data}/.awestruct_ignore +0 -0
- data/spec/{test-data → support/test-data}/engine/_config/arbitrary.yml +0 -0
- data/spec/{test-data/gzip/no.html.gz → support/test-data/engine/_config/compass.rb} +0 -0
- data/spec/{test-data → support/test-data}/engine/_config/other.yml +0 -0
- data/spec/{test-data → support/test-data}/engine/_config/site.yml +3 -0
- data/spec/{test-data → support/test-data}/front-matter-empty.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-file-no-content.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-file-no-front.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-file-utf8.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-file.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-looking.txt +0 -0
- data/spec/{test-data → support/test-data}/front-matter-middle.txt +0 -0
- data/spec/{test-data/gzip/no.txt → support/test-data/gzip/no.html.gz} +0 -0
- data/spec/{test-data/handlers/textile-empty-page.textile → support/test-data/gzip/no.txt} +0 -0
- data/spec/{test-data → support/test-data}/gzip/subdir/yes.css +0 -0
- data/spec/{test-data → support/test-data}/gzip/yes.html +0 -0
- data/spec/{test-data → support/test-data}/gzip/yes.js +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc-page.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc-page.adoc +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc-page.asciidoc +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc_with_attributes.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc_with_interpolation.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoc_without_interpolation.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoctor_with_front_matter.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/asciidoctor_with_headers.ad +0 -0
- data/spec/{test-data → support/test-data}/handlers/coffeescript-page.coffee +0 -0
- data/spec/{test-data → support/test-data}/handlers/empty-layout.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/erb-page.html.erb +0 -0
- data/spec/{test-data → support/test-data}/handlers/erb-page.xml.erb +0 -0
- data/spec/{test-data → support/test-data}/handlers/erb-utf-page.html.erb +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-error.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-layout-two.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-layout.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-page.atom.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-page.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-page.xml.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-with-markdown-page.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-with-textile-page.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-with-utf.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/haml-with-variables.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/hello.bogus +0 -0
- data/spec/{test-data → support/test-data}/handlers/inner-page.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/javascript-page.js +0 -0
- data/spec/{test-data → support/test-data}/handlers/less-page-include.less +0 -0
- data/spec/{test-data → support/test-data}/handlers/less-page-with-import.less +0 -0
- data/spec/{test-data → support/test-data}/handlers/less-page.less +0 -0
- data/spec/{test-data → support/test-data}/handlers/markdown-page.markdown +0 -0
- data/spec/{test-data → support/test-data}/handlers/markdown-page.md +0 -0
- data/spec/{test-data → support/test-data}/handlers/markdown-page.mkd +0 -0
- data/spec/{test-data → support/test-data}/handlers/mustache-page.html.mustache +0 -0
- data/spec/{test-data → support/test-data}/handlers/mustache-page.xml.mustache +0 -0
- data/spec/{test-data → support/test-data}/handlers/orgmode-page.org +0 -0
- data/spec/{test-data → support/test-data}/handlers/outer-layout.html.haml +0 -0
- data/spec/{test-data → support/test-data}/handlers/outside_relative/git_keep +0 -0
- data/spec/{test-data → support/test-data}/handlers/redirect-page.redirect +0 -0
- data/spec/{test-data → support/test-data}/handlers/restructuredtext-page.rst +0 -0
- data/spec/{test-data → support/test-data}/handlers/sass-page-include.sass +0 -0
- data/spec/{test-data → support/test-data}/handlers/sass-page.sass +0 -0
- data/spec/{test-data → support/test-data}/handlers/scss-page-include.scss +0 -0
- data/spec/{test-data → support/test-data}/handlers/scss-page.scss +0 -0
- data/spec/{test-data → support/test-data}/handlers/simple-redirect-page.redirect +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-page.atom.slim +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-page.html.slim +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-page.xml.slim +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-with-markdown-page.html.slim +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-with-utf.html.slim +0 -0
- data/spec/{test-data → support/test-data}/handlers/slim-with-variables.html.slim +0 -0
- data/spec/support/test-data/handlers/textile-empty-page.textile +0 -0
- data/spec/{test-data → support/test-data}/handlers/textile-page.textile +0 -0
- data/spec/{test-data → support/test-data}/images/logo.png +0 -0
- data/spec/{test-data → support/test-data}/index.html +0 -0
- data/spec/{test-data → support/test-data}/javascript/bootstrap-dropdown.js +0 -0
- data/spec/{test-data → support/test-data}/out-of-site/page-three.html.haml +0 -0
- data/spec/support/test-data/page-loader/.awestruct_ignore +2 -0
- data/spec/{test-data → support/test-data}/page-loader/_layouts/layout-one.md +0 -0
- data/spec/{test-data → support/test-data}/page-loader/_layouts/layout-two.html.haml +0 -0
- data/spec/{test-data → support/test-data}/page-loader/page-draft.md +0 -0
- data/spec/{test-data → support/test-data}/page-loader/page-one.md +0 -0
- data/spec/{test-data → support/test-data}/page-loader/page-two.html.haml +0 -0
- data/spec/{test-data → support/test-data}/simple-data.yaml +0 -0
- data/spec/{test-data → support/test-data}/simple-file.txt +0 -0
- data/spec/{test-data → support/test-data}/stylesheets/screen.css +0 -0
- data/spec/{test-data → support/test-data}/subdir/index.html +0 -0
- metadata +251 -232
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e5fd572c73f3b019598a5f63b741c5d0df96fcd0
|
4
|
+
data.tar.gz: 76e36c5b3f687e42c7d819f3a5e21b9ab938a027
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d904e79ab4c23037895cd7b1a916b08c7e2d8b0d21abcf5de54fb2d2981427b2d5a354d26af7cfda9eab520d89ea3f3c60537ed5b8e7717751a68337a787635c
|
7
|
+
data.tar.gz: 1e3dd26392ccc0179eee5b29573a0a6b358e35eb8e12b758d5ab4cc10eb827c002352bc3934a38b2541d58b399c3024fbb12f2dc19941176397f847d9da0fd58
|
data/Gemfile
CHANGED
@@ -1,29 +1,33 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem 'spectator', '
|
5
|
-
gem 'hashery', '
|
6
|
-
gem 'rspec', '
|
7
|
-
gem 'rake', '
|
4
|
+
gem 'spectator', '~> 1.2.6'
|
5
|
+
gem 'hashery', '~> 2.1.1'
|
6
|
+
gem 'rspec', '~> 2.14.1'
|
7
|
+
gem 'rake', '~> 10.2.2'
|
8
|
+
gem 'guard-rspec', '~> 4.2.0', :require => false
|
9
|
+
gem 'pry', '~> 0.9.12', :require => false
|
10
|
+
gem 'pry-nav', '~> 0.2', :require => false
|
8
11
|
end
|
9
12
|
|
10
13
|
group :test do
|
11
|
-
gem 'rb-inotify', '
|
12
|
-
gem 'rack-test'
|
13
|
-
gem 'tilt', '
|
14
|
-
gem 'coffee-script', '
|
15
|
-
gem 'asciidoctor', '
|
16
|
-
gem 'slim', '
|
17
|
-
gem 'kramdown', '
|
18
|
-
gem 'therubyracer', '0.10.0', :platforms => :ruby
|
19
|
-
gem 'therubyrhino', '~> 2.0.
|
20
|
-
gem 'less', '
|
21
|
-
gem 'org-ruby', '
|
22
|
-
gem 'RedCloth', '
|
23
|
-
gem 'mustache', '
|
24
|
-
gem 'uglifier', '
|
25
|
-
gem 'htmlcompressor', '
|
26
|
-
gem '
|
14
|
+
gem 'rb-inotify', '~> 0.9.3'
|
15
|
+
gem 'rack-test', '~> 0.6.2'
|
16
|
+
gem 'tilt', '~> 2.0.1'
|
17
|
+
gem 'coffee-script', '~> 2.2.0'
|
18
|
+
gem 'asciidoctor', '~> 0.1.4'
|
19
|
+
gem 'slim', '~> 2.0.2'
|
20
|
+
gem 'kramdown', '~> 1.3.3'
|
21
|
+
gem 'therubyracer', '~> 0.10.0', :platforms => :ruby
|
22
|
+
gem 'therubyrhino', '~> 2.0.3', :platforms => :jruby
|
23
|
+
gem 'less', '~> 2.5.0'
|
24
|
+
gem 'org-ruby', '~> 0.9.3'
|
25
|
+
gem 'RedCloth', '~> 4.2.9'
|
26
|
+
gem 'mustache', '~> 0.99.5'
|
27
|
+
gem 'uglifier', '~> 2.5.0'
|
28
|
+
gem 'htmlcompressor', '~> 0.0.7'
|
29
|
+
gem 'haml-contrib', '~> 1.0.0'
|
30
|
+
gem "win32-open3-19", :platforms => :mingw # htmlcompressor depends on old yui compressor, that needs this on win32
|
27
31
|
end
|
28
32
|
|
29
33
|
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2010-
|
1
|
+
Copyright (c) 2010-2014 Bob McWhirter and contributors (see git log)
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to
|
@@ -6,13 +6,13 @@ deal in the Software without restriction, including without limitation the
|
|
6
6
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
7
|
sell copies of the Software, and to permit persons to whom the Software is
|
8
8
|
furnished to do so, subject to the following conditions:
|
9
|
-
|
9
|
+
|
10
10
|
The above copyright notice and this permission notice shall be included in
|
11
11
|
all copies or substantial portions of the Software.
|
12
|
-
|
12
|
+
|
13
13
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
14
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
15
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
16
|
-
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
16
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
17
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
18
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Please see the complete site at <http://awestruct.org/>.
|
|
8
8
|
|
9
9
|
# License
|
10
10
|
|
11
|
-
Copyright (c) 2010-
|
11
|
+
Copyright (c) 2010-2014 Bob McWhirter and contributors (see git log)
|
12
12
|
|
13
13
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
14
|
of this software and associated documentation files (the "Software"), to
|
@@ -16,16 +16,16 @@ Please see the complete site at <http://awestruct.org/>.
|
|
16
16
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
17
17
|
sell copies of the Software, and to permit persons to whom the Software is
|
18
18
|
furnished to do so, subject to the following conditions:
|
19
|
-
|
19
|
+
|
20
20
|
The above copyright notice and this permission notice shall be included in
|
21
21
|
all copies or substantial portions of the Software.
|
22
|
-
|
22
|
+
|
23
23
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
24
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
25
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
26
|
-
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
26
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
27
27
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
28
28
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29
29
|
|
30
|
-
It also uses code from the Sequel project under the same license.
|
30
|
+
It also uses code from the Sequel project under the same license.
|
31
31
|
|
data/awestruct.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'awestruct/version'
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
5
|
s.name = 'awestruct'
|
6
6
|
s.version = Awestruct::VERSION
|
7
|
-
s.date = '
|
7
|
+
s.date = '2014-04-07'
|
8
8
|
|
9
9
|
s.authors = ['Bob McWhirter', 'Jason Porter', 'Lance Ball', 'Dan Allen', 'Torsten Curdt', 'other contributors']
|
10
10
|
s.email = ['bob@mcwhirter.org', 'lightguard.jp@gmail.com', 'lball@redhat.com', 'dan.j.allen@gmail.com', 'tcurdt@vafer.org']
|
@@ -32,17 +32,20 @@ Any markup languages you are using and its dependencies.
|
|
32
32
|
Haml and Markdown filters are touchy things. Redcarpet or Rdiscount work well if you're running on MRI. JRuby should be using haml 4.0.0+ with Kramdown.'
|
33
33
|
EOS
|
34
34
|
|
35
|
-
s.add_dependency 'haml', '~> 4.0.
|
36
|
-
s.add_dependency '
|
37
|
-
s.add_dependency '
|
38
|
-
s.add_dependency '
|
35
|
+
s.add_dependency 'haml', '~> 4.0.5'
|
36
|
+
s.add_dependency 'asciidoctor' # we're pretty good about backwards compat
|
37
|
+
s.add_dependency 'nokogiri', '~> 1.5.10'
|
38
|
+
s.add_dependency 'tilt', '~> 2.0.1'
|
39
|
+
s.add_dependency 'compass', '~> 0.12.4'
|
39
40
|
s.add_dependency 'compass-960-plugin', '~> 0.10.4'
|
40
|
-
s.add_dependency 'bootstrap-sass', '
|
41
|
-
s.add_dependency 'zurb-foundation', '
|
42
|
-
s.add_dependency 'mime-types', '1
|
43
|
-
s.add_dependency 'rest-client', '
|
41
|
+
s.add_dependency 'bootstrap-sass', '~> 3.1.1.0'
|
42
|
+
s.add_dependency 'zurb-foundation', '~> 4.3.2'
|
43
|
+
s.add_dependency 'mime-types', '~> 2.1'
|
44
|
+
s.add_dependency 'rest-client', '~> 1.6.7'
|
44
45
|
s.add_dependency 'ruby-s3cmd', '~> 0.1.5'
|
45
|
-
|
46
|
-
s.add_dependency 'listen', '~> 1.0'
|
46
|
+
s.add_dependency 'listen', '~> 2.7.1'
|
47
47
|
s.add_dependency 'rack', '~> 1.5.2'
|
48
|
+
s.add_dependency 'git', '~> 1.2.6'
|
49
|
+
s.add_dependency 'guard-livereload', '~> 2.1.2'
|
50
|
+
s.add_dependency 'colorize', '~> 0.7.1'
|
48
51
|
end
|
data/lib/awestruct/cli/auto.rb
CHANGED
@@ -1,28 +1,34 @@
|
|
1
|
-
#require 'guard/awestruct'
|
2
1
|
require 'awestruct/util/exception_helper'
|
3
2
|
|
4
3
|
require 'listen'
|
4
|
+
require 'guard/livereload'
|
5
5
|
|
6
6
|
module Awestruct
|
7
7
|
module CLI
|
8
8
|
class Auto
|
9
9
|
|
10
|
-
def initialize(config)
|
10
|
+
def initialize(config, base_url)
|
11
11
|
@config = config
|
12
|
+
@base_url = base_url
|
12
13
|
end
|
13
14
|
|
14
15
|
def run()
|
15
16
|
generate_thread = nil
|
16
17
|
current_path = nil
|
17
18
|
|
19
|
+
guard = if ( @config.options.livereload )
|
20
|
+
guard = Guard::LiveReload.new
|
21
|
+
guard.start
|
22
|
+
guard
|
23
|
+
else
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
18
27
|
force_polling = ( RUBY_PLATFORM =~ /mingw/ ? true : false )
|
19
|
-
listener = Listen.to( @config.dir, :
|
20
|
-
|
21
|
-
listener.ignore( %r(^#{File.basename( @config.tmp_dir )}) )
|
22
|
-
listener.ignore( %r(^#{File.basename( @config.output_dir )}) )
|
23
|
-
listener.change do |modified, added, removed|
|
24
|
-
modified.each do |path|
|
28
|
+
listener = Listen.to( @config.dir, :latency=>0.5, :force_polling=>force_polling ) do |modified, added, removed|
|
29
|
+
modified.each do |path| # path is absolute path
|
25
30
|
engine = ::Awestruct::Engine.instance
|
31
|
+
|
26
32
|
unless ( path =~ %r(#{File.basename( engine.config.output_dir) }) || path =~ /.awestruct/ )
|
27
33
|
begin
|
28
34
|
if path.eql? current_path
|
@@ -37,8 +43,26 @@ module Awestruct
|
|
37
43
|
|
38
44
|
generate_thread = Thread.new {
|
39
45
|
begin
|
40
|
-
|
41
|
-
|
46
|
+
|
47
|
+
page = engine.page_by_output_path(path)
|
48
|
+
if ( page )
|
49
|
+
|
50
|
+
pages = engine.generate_page_and_dependencies( page )
|
51
|
+
|
52
|
+
if ( guard )
|
53
|
+
urls = pages.map do |p|
|
54
|
+
@base_url + p.url.to_s
|
55
|
+
end
|
56
|
+
|
57
|
+
guard.run_on_modifications(urls)
|
58
|
+
end
|
59
|
+
|
60
|
+
$LOG.info "Regeneration finished." if $LOG.info?
|
61
|
+
|
62
|
+
else
|
63
|
+
$LOG.error "Failed to find page from path #{path}"
|
64
|
+
end
|
65
|
+
|
42
66
|
rescue => e
|
43
67
|
ExceptionHelper.log_building_error e, path
|
44
68
|
end
|
@@ -49,7 +73,10 @@ module Awestruct
|
|
49
73
|
end
|
50
74
|
end
|
51
75
|
end
|
52
|
-
listener.
|
76
|
+
listener.ignore( %r(\.awestruct) )
|
77
|
+
listener.ignore( %r(^#{File.basename( @config.tmp_dir )}) )
|
78
|
+
listener.ignore( %r(^#{File.basename( @config.output_dir )}) )
|
79
|
+
listener.start
|
53
80
|
end
|
54
81
|
|
55
82
|
end
|
@@ -2,6 +2,7 @@ require 'pathname'
|
|
2
2
|
require 'logger'
|
3
3
|
require 'awestruct/logger'
|
4
4
|
require 'awestruct/cli/options'
|
5
|
+
require 'awestruct/util/exception_helper'
|
5
6
|
|
6
7
|
module Awestruct
|
7
8
|
module CLI
|
@@ -37,58 +38,72 @@ module Awestruct
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def invoke!
|
40
|
-
|
41
|
+
begin
|
42
|
+
load_profile() unless ( options.init )
|
43
|
+
|
44
|
+
setup_config()
|
45
|
+
|
46
|
+
invoke_init() if ( options.init )
|
47
|
+
invoke_script() if ( options.script )
|
48
|
+
invoke_force() if ( options.force )
|
49
|
+
invoke_generate() if ( options.generate )
|
50
|
+
invoke_deploy() if ( options.deploy )
|
51
|
+
invoke_server() if ( options.server )
|
52
|
+
invoke_auto() if ( options.auto )
|
53
|
+
|
54
|
+
wait_for_completion()
|
55
|
+
@success = false if ExceptionHelper.build_failed?
|
56
|
+
rescue
|
57
|
+
@success = false
|
58
|
+
false
|
59
|
+
end
|
60
|
+
end
|
41
61
|
|
42
|
-
|
62
|
+
def load_profile()
|
63
|
+
site_yaml_file = File.join( @options.source_dir, '_config', 'site.yml' )
|
43
64
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
invoke_generate() if ( options.generate )
|
48
|
-
invoke_deploy() if ( options.deploy )
|
49
|
-
invoke_server() if ( options.server )
|
50
|
-
invoke_auto() if ( options.auto )
|
65
|
+
if ( !File.exist?( site_yaml_file ) )
|
66
|
+
abort( "No config file at #{site_yaml_file}" )
|
67
|
+
end
|
51
68
|
|
52
|
-
|
53
|
-
success
|
54
|
-
end
|
69
|
+
site_yaml = YAML.load( File.read( site_yaml_file ) )
|
55
70
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
71
|
+
if ( !site_yaml )
|
72
|
+
abort( "Failed to parse #{site_yaml_file}" )
|
73
|
+
end
|
74
|
+
|
75
|
+
profiles = site_yaml['profiles'] || {}
|
76
|
+
|
77
|
+
profile_name = options.profile
|
78
|
+
|
79
|
+
# use the one specified
|
80
|
+
profile = profiles[profile_name]
|
81
|
+
if ( !profile )
|
82
|
+
profile_name, profile = if ( options.deploy )
|
83
|
+
# or the first one having a deploy section
|
84
|
+
profiles.select { |k,v| v && v['deploy'] }
|
85
|
+
else
|
86
|
+
# or the first one having no deploy section
|
87
|
+
profiles.select { |k,v| v && !v['deploy'] }
|
88
|
+
end.first
|
74
89
|
end
|
75
|
-
|
76
|
-
|
77
|
-
$LOG.
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
$LOG.info "Using profile: #{options.profile}" if $LOG.info?
|
90
|
+
|
91
|
+
if profile
|
92
|
+
$LOG.info "Using profile: #{profile_name}" if $LOG.info?
|
93
|
+
end
|
94
|
+
|
95
|
+
@profile = profile || {}
|
82
96
|
end
|
83
97
|
|
84
98
|
def setup_config()
|
85
99
|
@config = Awestruct::Config.new( @options )
|
86
100
|
@config.track_dependencies = true if ( @options.auto )
|
87
101
|
@config.verbose = true if ( @options.verbose )
|
102
|
+
@config.quiet = true if ( @options.quiet )
|
88
103
|
end
|
89
104
|
|
90
105
|
def invoke_init()
|
91
|
-
Awestruct::CLI::Init.new(
|
106
|
+
Awestruct::CLI::Init.new( @options.source_dir, @options.framework, @options.scaffold ).run
|
92
107
|
end
|
93
108
|
|
94
109
|
def invoke_script()
|
@@ -118,7 +133,8 @@ module Awestruct
|
|
118
133
|
end
|
119
134
|
|
120
135
|
def invoke_auto()
|
121
|
-
|
136
|
+
base_url = profile['base_url'] || options.base_url
|
137
|
+
Awestruct::CLI::Auto.new( config, base_url ).run
|
122
138
|
end
|
123
139
|
|
124
140
|
def invoke_server()
|
@@ -31,24 +31,28 @@ module Awestruct
|
|
31
31
|
attr_accessor :deploy
|
32
32
|
attr_accessor :script
|
33
33
|
attr_accessor :verbose
|
34
|
+
attr_accessor :quiet
|
34
35
|
attr_accessor :source_dir
|
35
36
|
attr_accessor :output_dir
|
37
|
+
attr_accessor :livereload
|
36
38
|
|
37
39
|
def initialize()
|
38
|
-
@generate
|
39
|
-
@server
|
40
|
-
@port
|
41
|
-
@bind_addr
|
42
|
-
@auto
|
43
|
-
@force
|
44
|
-
@init
|
45
|
-
@framework
|
46
|
-
@scaffold
|
47
|
-
@base_url
|
48
|
-
@profile
|
49
|
-
@deploy
|
50
|
-
@script
|
51
|
-
@verbose
|
40
|
+
@generate = nil
|
41
|
+
@server = false
|
42
|
+
@port = DEFAULT_PORT
|
43
|
+
@bind_addr = DEFAULT_BIND_ADDR
|
44
|
+
@auto = false
|
45
|
+
@force = false
|
46
|
+
@init = false
|
47
|
+
@framework = 'compass'
|
48
|
+
@scaffold = true
|
49
|
+
@base_url = nil
|
50
|
+
@profile = nil
|
51
|
+
@deploy = false
|
52
|
+
@script = nil
|
53
|
+
@verbose = false
|
54
|
+
@quiet = false
|
55
|
+
@livereload = false
|
52
56
|
@source_dir = Dir.pwd
|
53
57
|
@output_dir = File.expand_path '_site'
|
54
58
|
end
|
@@ -62,6 +66,9 @@ module Awestruct
|
|
62
66
|
opts.on('-w', '--verbose', 'Enable verbose mode') do |verbose|
|
63
67
|
self.verbose = true
|
64
68
|
end
|
69
|
+
opts.on('-q', '--quiet', 'Only display warnings and errors') do |quiet|
|
70
|
+
self.quiet = true
|
71
|
+
end
|
65
72
|
opts.on( '-i', '--init', 'Initialize a new project in the current directory' ) do |init|
|
66
73
|
self.init = init
|
67
74
|
self.generate = false
|
@@ -87,19 +94,22 @@ module Awestruct
|
|
87
94
|
self.port = DEFAULT_PORT
|
88
95
|
self.profile = 'development'
|
89
96
|
end
|
97
|
+
opts.on( '-a', '--auto', 'Auto-generate when changes are noticed' ) do |a|
|
98
|
+
self.auto = a
|
99
|
+
end
|
100
|
+
opts.on( '--livereload', 'Support for browser livereload' ) do |livereload|
|
101
|
+
self.livereload = livereload
|
102
|
+
end
|
90
103
|
|
91
104
|
opts.on( '-P', '--profile PROFILE', 'Activate a configuration profile' ) do |profile|
|
92
105
|
self.profile = profile
|
93
106
|
end
|
94
|
-
|
107
|
+
|
95
108
|
opts.on( '--deploy', 'Deploy site' ) do |deploy|
|
96
109
|
self.deploy = deploy
|
97
110
|
self.generate = false if self.generate.nil?
|
98
111
|
end
|
99
|
-
|
100
|
-
opts.on( '-a', '--auto', 'Auto-generate when changes are noticed' ) do |a|
|
101
|
-
self.auto = a
|
102
|
-
end
|
112
|
+
|
103
113
|
opts.on( '-p', '--port PORT', Integer, "Server port (default: #{DEFAULT_PORT})" ) do |port|
|
104
114
|
self.port = port
|
105
115
|
end
|
@@ -119,15 +129,15 @@ module Awestruct
|
|
119
129
|
opts.on( '--output-dir DIR', 'Location to output generated site (default: _site' ) do |output_dir|
|
120
130
|
self.output_dir = File.expand_path output_dir
|
121
131
|
end
|
122
|
-
|
132
|
+
|
123
133
|
opts.separator ''
|
124
134
|
opts.separator "Common options:"
|
125
|
-
|
135
|
+
|
126
136
|
opts.on_tail("-h", "--help", "Show this message") do
|
127
137
|
puts opts
|
128
138
|
exit
|
129
139
|
end
|
130
|
-
|
140
|
+
|
131
141
|
opts.on_tail("-v", "--version", "Display the version") do
|
132
142
|
puts "Awestruct: #{Awestruct::VERSION}"
|
133
143
|
puts "http://awestruct.org/"
|