awestruct 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7a08d19ea467620afb84c0396162767bb2df5c1d
4
- data.tar.gz: 0e7d000b9298c47c01d2c07c228736a68de3f8bf
2
+ SHA256:
3
+ metadata.gz: cbfde0af291abd73352c5250d0d43fb1ba1a0e90ddd97bd697ed5ed24072b435
4
+ data.tar.gz: b4f5566a1d739e41614ebe9f13836deb69d384f921f9c644f080865fcf472f78
5
5
  SHA512:
6
- metadata.gz: ebcae9f08b9ad9687eacfff2dad6589a0af5bbc3861f2336e3021c4bd82db7e890301169fad6dd3f0f3e24a7c0bffa2c9d50213e806d48ed9081541631259487
7
- data.tar.gz: e05a713a980aabc1bc895bef7c6a25baa5a6af3f0bdd7135b535532823256b03b11965481a025a3139875f658aaba1bc74c10ac288ea8914b7dbd23d2a7831a0
6
+ metadata.gz: db3fa768353f108cf524fe7db7527ff997e5ce545228cd2c12ec859f07be1a98f5c8c5e8d6f675b530b3c24a358b214e9e924e00a6a14fc1fdf3155228f210a1
7
+ data.tar.gz: c06a668a66477b7826546cf61a8963bc8ddb65ec1601555e38c12c61247eea53f7fd1fd65806e4b36f8412640037b8030223a005d5fe676ce20ec781110586b3
data/Gemfile CHANGED
@@ -15,12 +15,10 @@ group :test do
15
15
  gem 'coffee-script', '~> 2.2.0'
16
16
  gem 'asciidoctor', '1.5.2'
17
17
  gem 'compass', '>= 1.0.1'
18
- gem 'sassc', '~> 1.6'
18
+ gem 'sassc', '~> 2.0'
19
19
  gem 'slim', '~> 3.0'
20
- gem 'kramdown', '~> 1.3.3'
21
- gem 'therubyracer', '~> 0.12.1', :platforms => :ruby
20
+ gem 'kramdown', '~> 2.4.0'
22
21
  gem 'therubyrhino', '~> 2.0.3', :platforms => :jruby
23
- gem 'less', '~> 2.5.0'
24
22
  gem 'org-ruby', '~> 0.9.3'
25
23
  gem 'RedCloth', '~> 4.2.9'
26
24
  gem 'mustache', '~> 0.99.5'
@@ -28,6 +26,7 @@ group :test do
28
26
  gem 'htmlcompressor', '~> 0.0.7'
29
27
  gem 'haml-contrib', '~> 1.0.0'
30
28
  gem 'sass'
29
+ gem 'ffi', '~> 1.15.5'
31
30
  gem 'bootstrap-sass'
32
31
  gem 'zurb-foundation'
33
32
  gem 'rspec'
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 = '2020-02-20'
7
+ s.date = '2023-01-21'
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']
@@ -12,14 +12,11 @@ spec = Gem::Specification.new do |s|
12
12
  s.summary = 'Static site baking and publishing tool'
13
13
  s.description = 'Awestruct is a static site baking and publishing tool. It supports an extensive list of both templating and markup languages via Tilt (Haml, Slim, AsciiDoc, Markdown, Sass via Compass, etc), provides mobile-first layout and styling via Bootstrap or Foundation, offers a variety of deployment options (rsync, git, S3), handles site optimizations (minification, compression, cache busting), includes built-in extensions such as blog post management and is highly extensible.'
14
14
 
15
- s.rubyforge_project = s.name
16
-
17
15
  s.license = 'MIT'
18
16
 
19
17
  s.platform = Gem::Platform::RUBY
20
18
  s.required_ruby_version = '>= 2.4.0'
21
19
 
22
- s.has_rdoc = true
23
20
  s.rdoc_options = ['--charset=UTF-8']
24
21
  s.extra_rdoc_files = 'README.md'
25
22
 
@@ -35,7 +32,7 @@ Compass and sass are no longer hard dependencies. You'll need too add them on yo
35
32
  EOS
36
33
 
37
34
  s.add_dependency 'haml', '>= 4.0.5', '< 6.0'
38
- s.add_dependency 'asciidoctor', '~> 1.5', '>= 1.5.2'
35
+ s.add_dependency 'asciidoctor', '>= 1.5.2', '<3.0'
39
36
  s.add_dependency 'tilt', '~> 2.0', '>= 2.0.1'
40
37
  s.add_dependency 'mime-types', '~> 3.0'
41
38
  s.add_dependency 'rest-client', '~> 2.0'
@@ -19,7 +19,7 @@ module Awestruct
19
19
  mkdir('stylesheets')
20
20
  }
21
21
 
22
- def initialize(dir = Dir.pwd, framework = 'compass', scaffold = true)
22
+ def initialize(dir = Dir.pwd, framework = 'none', scaffold = true)
23
23
  @dir = dir
24
24
  @framework = framework
25
25
  @scaffold = scaffold
@@ -97,7 +97,7 @@ module Awestruct
97
97
  abort( "No config file at #{site_yaml_file}" )
98
98
  end
99
99
 
100
- site_yaml = YAML.load( ERB.new(File.read( site_yaml_file ), nil, '<>').result )
100
+ site_yaml = YAML.load( ERB.new(File.read( site_yaml_file ), trim_mode: '<>').result )
101
101
 
102
102
  if ( !site_yaml )
103
103
  abort( "Failed to parse #{site_yaml_file}" )
@@ -232,7 +232,7 @@ module Awestruct
232
232
  def perform(dir)
233
233
 
234
234
  begin
235
- rendered = ERB.new(File.read(@input_path), nil, '<>').result(
235
+ rendered = ERB.new(File.read(@input_path), trim_mode: '<>').result(
236
236
  OpenStruct.new(@state).instance_eval { binding })
237
237
  rescue => e
238
238
  $LOG.debug "::DEBUG:: #{e.message} state - #{@state}"
@@ -43,7 +43,7 @@ module Awestruct
43
43
 
44
44
  # Dir[] doesn't like empty list
45
45
  ignore_file = File.join(@dir, ".awestruct_ignore")
46
- if File.exists?(ignore_file)
46
+ if File.exist?(ignore_file)
47
47
  ignore_stmts = IO.read(ignore_file).each_line.map(&:strip)
48
48
  end
49
49
 
@@ -1,6 +1,7 @@
1
1
  require 'awestruct/util/inflector'
2
2
  require 'awestruct/util/exception_helper'
3
3
  require 'awestruct/util/default_inflections'
4
+ require 'awestruct/util/yaml_load'
4
5
 
5
6
  require 'awestruct/config'
6
7
  require 'awestruct/site'
@@ -181,7 +182,7 @@ module Awestruct
181
182
  def load_site_yaml(yaml_path, profile = nil)
182
183
  if File.exist?(yaml_path)
183
184
  begin
184
- data = YAML.load( ERB.new(File.read( yaml_path, :encoding => 'bom|utf-8' ), nil, '<>').result )
185
+ data = Awestruct.yaml_load( ERB.new(File.read( yaml_path, :encoding => 'bom|utf-8' ), trim_mode: '<>').result)
185
186
  if profile
186
187
  # JP: Interpolation now turned off by default, turn it per page if needed
187
188
  site.interpolate = false
@@ -211,7 +212,7 @@ module Awestruct
211
212
 
212
213
  def load_yaml(yaml_path)
213
214
  begin
214
- data = YAML.load( ERB.new(File.read( yaml_path ), nil, '<>').result )
215
+ data = Awestruct.yaml_load( ERB.new(File.read( yaml_path ), trim_mode: '<>').result )
215
216
  rescue Exception => e
216
217
  ExceptionHelper.log_building_error e, yaml_path
217
218
  ExceptionHelper.mark_failed
@@ -283,7 +284,7 @@ module Awestruct
283
284
  def load_pipeline
284
285
  ext_dir = File.join( site.config.extension_dir )
285
286
  pipeline_file = File.join( ext_dir, 'pipeline.rb' )
286
- if File.exists?(pipeline_file)
287
+ if File.exist?(pipeline_file)
287
288
  p = eval(File.read( pipeline_file ), nil, pipeline_file, 1)
288
289
  p.before_all_extensions.each do |e|
289
290
  pipeline.add_before_extension( e )
@@ -379,7 +380,7 @@ module Awestruct
379
380
  end
380
381
 
381
382
  compass_config_file = File.join(site.config.config_dir, 'compass.rb')
382
- if File.exists? compass_config_file
383
+ if File.exist? compass_config_file
383
384
  ::Compass.add_configuration ::Compass::Configuration::FileData.new_from_file(compass_config_file)
384
385
  end
385
386
  ::Compass.configuration # return for use elsewhere
@@ -5,7 +5,7 @@ module Awestruct
5
5
  def partial(path, params = {})
6
6
  filename = File.join( ::Awestruct::Engine.instance.config.dir, '_partials', path )
7
7
 
8
- if !File.exists?( filename )
8
+ if !File.exist?( filename )
9
9
  $LOG.error "Could not find #{filename}" if $LOG.error?
10
10
  return nil
11
11
  end
@@ -9,8 +9,6 @@
9
9
  padding-top: 60px;
10
10
  }
11
11
  %link{ :rel=>'stylesheet', :type=>'text/css', :href=>"#{site.base_url}/stylesheets/styles.css" }
12
- /[if lt IE 9]
13
- %script{ :type=>'text/javascript', :src=>'//html5shim.googlecode.com/svn/trunk/html5.js' }
14
12
  %body
15
13
  %nav.navbar.navbar-default.navbar-fixed-top{:role=>'navigation'}
16
14
  .container-fluid
@@ -0,0 +1,29 @@
1
+ ---
2
+ layout: base
3
+ ---
4
+ .jumbotron
5
+ %h1 You're awestruct!
6
+ %p This site is all setup to Awestruct.
7
+ %p
8
+ %a.btn.btn-primary.btn-lg{ :href=>'http://awestruct.org', :role=>"button" }
9
+ %i.icon-info-sign.icon-white
10
+ Learn more &raquo;
11
+
12
+ .container-fluid
13
+ .row
14
+ .col-md-4
15
+ %h2 About
16
+ %p Awestruct is a framework for creating static HTML sites. It's inspired by the awesome Jekyll utility in the same genre.
17
+ %p Additionally, Awestruct integrates technologies such as Compass, Markdown and Haml.
18
+ %p
19
+ %a.btn{ :href=>'http://awestruct.org' } View details &raquo;
20
+ .col-md-4
21
+ %h2 Goal
22
+ %p The goal of Awestruct is to make it trivially easy to bake out non-trivial static websites. In addition to providing template-driven site creation (using Haml), Awestruct provides facilities for easily priming the site creation with additional non-page data.
23
+ %p
24
+ %a.btn{ :href=>'http://awestruct.org' } View details &raquo;
25
+ .col-md-4
26
+ %h2 Concept
27
+ %p The core concept of Awestruct is that of structures, specifically Ruby OpenStruct structures. The struct aspect allows arbitrary, schema-less data to be associated with a specific page or the entire site.
28
+ %p
29
+ %a.btn{ :href=>'http://awestruct.org' } View details &raquo;
@@ -0,0 +1,28 @@
1
+ !!!5
2
+ %html
3
+ %head
4
+ %meta{ :charset=>'utf-8' }
5
+ %title An awesome site
6
+ %meta{ :name=>'viewport', :content=>'width=device-width, initial-scale=1.0' }
7
+ :css
8
+ body {
9
+ padding-top: 60px;
10
+ }
11
+ %link{ :rel=>'stylesheet', :type=>'text/css', :href=>"#{site.base_url}/stylesheets/styles.css" }
12
+ %body
13
+ %nav.navbar.navbar-default.navbar-fixed-top{:role=>'navigation'}
14
+ .container-fluid
15
+ .navbar-header
16
+ %a.navbar-brand{ :href=>"#{site.base_url}" } #{site.name}
17
+
18
+ %ul.nav.navbar-nav.navbar-right
19
+ %li
20
+ %a{ :href=>"#{site.base_url}" } Home
21
+
22
+ .container
23
+ ~ content
24
+ %hr
25
+ %footer
26
+ %p &copy; #{site.org} #{Date.today.year}
27
+ -# Uncomment script tags (remove leading -#) when you're ready to use behaviors
28
+ -# %script{ :type=>'text/javascript', :src=>'//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js' }
@@ -1,4 +1,5 @@
1
1
  require 'awestruct/handler_chain'
2
+ require 'awestruct/util/yaml_load'
2
3
  require 'awestruct/handlers/base_tilt_handler'
3
4
  require 'awestruct/handlers/file_handler'
4
5
  require 'awestruct/handlers/layout_handler'
@@ -136,7 +137,7 @@ module Awestruct
136
137
  template = ::Tilt::new(delegate.path.to_s, delegate.content_line_offset + 1, options)
137
138
  headers = template.parse_headers(content, /^(?:page|awestruct)\-(?=.)/).inject({'interpolate' => false}) do |hash, (k,v)|
138
139
  unless v.nil?
139
- hash[k] = v.empty? ? v : YAML.load(v)
140
+ hash[k] = v.empty? ? v : Awestruct.yaml_load(v)
140
141
  if hash[k].kind_of? Time
141
142
  # use DateTime to preserve timezone information
142
143
  hash[k] = DateTime.parse(v)
@@ -0,0 +1,8 @@
1
+ require 'yaml'
2
+
3
+ module Awestruct
4
+ def self.yaml_load(str)
5
+ return YAML.load(str) unless YAML.method('load').parameters.any? {|k,v| v == :permitted_classes}
6
+ YAML.load(str, permitted_classes: [Date, Symbol])
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Awestruct
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -11,6 +11,10 @@ describe Awestruct::CLI::Init do
11
11
  FileUtils.rm_rf 'spec/support/clean_init'
12
12
  end
13
13
 
14
+ it "should not fail during init without framework" do
15
+ init = Awestruct::CLI::Init.new('spec/support/clean_init')
16
+ expect(init.run).to eql true
17
+ end
14
18
  it "should not fail during init with foundation" do
15
19
  init = Awestruct::CLI::Init.new('spec/support/clean_init', 'foundation', true)
16
20
  expect(init.run).to eql true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awestruct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob McWhirter
@@ -10,10 +10,10 @@ authors:
10
10
  - Dan Allen
11
11
  - Torsten Curdt
12
12
  - other contributors
13
- autorequire:
13
+ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2020-02-20 00:00:00.000000000 Z
16
+ date: 2023-01-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: haml
@@ -39,22 +39,22 @@ dependencies:
39
39
  name: asciidoctor
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: '1.5'
45
42
  - - ">="
46
43
  - !ruby/object:Gem::Version
47
44
  version: 1.5.2
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.5'
55
52
  - - ">="
56
53
  - !ruby/object:Gem::Version
57
54
  version: 1.5.2
55
+ - - "<"
56
+ - !ruby/object:Gem::Version
57
+ version: '3.0'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: tilt
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -413,6 +413,8 @@ files:
413
413
  - lib/awestruct/frameworks/foundation/base_index.html.haml
414
414
  - lib/awestruct/frameworks/foundation/base_layout.html.haml
415
415
  - lib/awestruct/frameworks/foundation/humans.txt
416
+ - lib/awestruct/frameworks/none/base_index.html.haml
417
+ - lib/awestruct/frameworks/none/base_layout.html.haml
416
418
  - lib/awestruct/handler_chain.rb
417
419
  - lib/awestruct/handler_chains.rb
418
420
  - lib/awestruct/handlers/asciidoctor_handler.rb
@@ -448,6 +450,7 @@ files:
448
450
  - lib/awestruct/util/default_inflections.rb
449
451
  - lib/awestruct/util/exception_helper.rb
450
452
  - lib/awestruct/util/inflector.rb
453
+ - lib/awestruct/util/yaml_load.rb
451
454
  - lib/awestruct/version.rb
452
455
  - man/awestruct.1
453
456
  - man/awestruct.adoc
@@ -478,7 +481,6 @@ files:
478
481
  - spec/awestruct/handlers/interpolation_handler_spec.rb
479
482
  - spec/awestruct/handlers/javascript_handler_spec.rb
480
483
  - spec/awestruct/handlers/layout_handler_spec.rb
481
- - spec/awestruct/handlers/less_handler_spec.rb
482
484
  - spec/awestruct/handlers/markdown_handler_spec.rb
483
485
  - spec/awestruct/handlers/mustache_handler_spec.rb
484
486
  - spec/awestruct/handlers/orgmode_handler_spec.rb
@@ -607,7 +609,7 @@ homepage: http://awestruct.org
607
609
  licenses:
608
610
  - MIT
609
611
  metadata: {}
610
- post_install_message:
612
+ post_install_message:
611
613
  rdoc_options:
612
614
  - "--charset=UTF-8"
613
615
  require_paths:
@@ -627,9 +629,8 @@ requirements:
627
629
  Any markup languages you are using and its dependencies.
628
630
  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.
629
631
  Compass and sass are no longer hard dependencies. You'll need too add them on your own should you want them. We also should be able to work with sassc.
630
- rubyforge_project: awestruct
631
- rubygems_version: 2.6.1
632
- signing_key:
632
+ rubygems_version: 3.3.3
633
+ signing_key:
633
634
  specification_version: 4
634
635
  summary: Static site baking and publishing tool
635
636
  test_files:
@@ -660,7 +661,6 @@ test_files:
660
661
  - spec/awestruct/handlers/interpolation_handler_spec.rb
661
662
  - spec/awestruct/handlers/javascript_handler_spec.rb
662
663
  - spec/awestruct/handlers/layout_handler_spec.rb
663
- - spec/awestruct/handlers/less_handler_spec.rb
664
664
  - spec/awestruct/handlers/markdown_handler_spec.rb
665
665
  - spec/awestruct/handlers/mustache_handler_spec.rb
666
666
  - spec/awestruct/handlers/orgmode_handler_spec.rb
@@ -1,33 +0,0 @@
1
- require 'spec_helper'
2
-
3
- verify = lambda { |output|
4
- output.should =~ /\.class {\n width: 2;\n}/
5
- }
6
-
7
- theories =
8
- [
9
- {
10
- :page => "less-page.less",
11
- :simple_name => "less-page",
12
- :syntax => :less,
13
- :extension => '.css',
14
- :matcher => verify
15
- },
16
- {
17
- :page => "less-page-with-import.less",
18
- :simple_name => "less-page-with-import",
19
- :syntax => :less,
20
- :extension => '.css',
21
- :matcher => verify,
22
- :unless => {
23
- :message => "Tilt 1.3.3 does not forward given options to Less parser. @import won't work unless :paths are set",
24
- :exp => lambda { Tilt::VERSION.eql? "1.3.3" }
25
- }
26
- }
27
- ]
28
-
29
- describe Awestruct::Handlers::TiltHandler.to_s + "-Less" do
30
-
31
- it_should_behave_like "a handler", theories
32
-
33
- end