awestruct 0.5.6 → 0.5.7.RC1

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.
@@ -1,3 +1,3 @@
1
1
  module Awestruct
2
- VERSION = '0.5.6'
2
+ VERSION = '0.5.7.RC1'
3
3
  end
@@ -11,11 +11,7 @@ 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 with compass" do
15
- init = Awestruct::CLI::Init.new('spec/support/clean_init', 'compass', true)
16
- expect(init.run).to eql true
17
- end
18
- it "should not fail during init with foundation" do
14
+ it "should not fail during init with foundation" do
19
15
  init = Awestruct::CLI::Init.new('spec/support/clean_init', 'foundation', true)
20
16
  expect(init.run).to eql true
21
17
  end
@@ -23,8 +19,4 @@ describe Awestruct::CLI::Init do
23
19
  init = Awestruct::CLI::Init.new('spec/support/clean_init', 'bootstrap', true)
24
20
  expect(init.run).to eql true
25
21
  end
26
- it "should not fail during init with 960" do
27
- init = Awestruct::CLI::Init.new('spec/support/clean_init', '960', true)
28
- expect(init.run).to eql true
29
- end
30
22
  end
@@ -10,7 +10,7 @@ describe Awestruct::CLI::Options do
10
10
  options.deploy.should == false
11
11
 
12
12
  options.port.should == 4242
13
- options.bind_addr.should == '0.0.0.0'
13
+ options.bind_addr.should == 'localhost'
14
14
 
15
15
  options.auto.should == false
16
16
  options.force.should == false
@@ -105,6 +105,7 @@ describe Awestruct::Engine do
105
105
  end
106
106
 
107
107
  it "should exclude line comments and minify in compass by default in production mode" do
108
+ require 'compass'
108
109
  opts = Awestruct::CLI::Options.new
109
110
  opts.source_dir = test_data_dir 'engine'
110
111
 
@@ -121,6 +122,7 @@ describe Awestruct::Engine do
121
122
  end
122
123
 
123
124
  it "should include line comments in compass by default in development mode" do
125
+ require 'compass'
124
126
  opts = Awestruct::CLI::Options.new
125
127
  opts.source_dir = test_data_dir 'engine'
126
128
  config = Awestruct::Config.new( opts )
@@ -229,6 +231,7 @@ describe Awestruct::Engine do
229
231
  end
230
232
 
231
233
  it "should accept site.compass_line_comments and site.compass_output_style to configure behavior" do
234
+ require 'compass'
232
235
  opts = Awestruct::CLI::Options.new
233
236
  opts.source_dir = test_data_dir 'engine'
234
237
  config = Awestruct::Config.new( opts )
@@ -241,6 +244,7 @@ describe Awestruct::Engine do
241
244
  end
242
245
 
243
246
  it "with a _config/compass.rb file, it should override defaults" do
247
+ require 'compass'
244
248
  opts = Awestruct::CLI::Options.new
245
249
  opts.source_dir = test_data_dir 'engine-compass'
246
250
  config = Awestruct::Config.new( opts )
@@ -1,8 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  verify = lambda { |output|
4
- output.should =~ /#test \{/
5
- output.should =~ /background-color: #ce4dd6; \}/
4
+ output.should =~ /#test\s*\{\s*background-color:\s*#ce4dd6;\s*\}/
6
5
  }
7
6
 
8
7
  theories =
@@ -1,8 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  verify = lambda { |output|
4
- output.should =~ /#test \{/
5
- output.should =~ /background-color: #ce4dd6; \}/
4
+ output.should =~ /#test\s*\{\s*background-color:\s*#ce4dd6;\s*\}/
6
5
  }
7
6
 
8
7
  theories =
@@ -32,7 +32,7 @@ theories =
32
32
  :simple_name => 'slim-page',
33
33
  :syntax => :slim,
34
34
  :extension => '.html',
35
- :format => :html5,
35
+ :format => :html,
36
36
  :matcher => verify
37
37
  },
38
38
  {
@@ -0,0 +1,106 @@
1
+ require 'awestruct/rack/debug'
2
+ require 'rack/test'
3
+
4
+ describe Awestruct::Rack::Debug do
5
+
6
+ class TestObject
7
+
8
+ attr_accessor :name
9
+
10
+ def initialize(name)
11
+ @name = name
12
+ end
13
+
14
+ def to_s
15
+ @name
16
+ end
17
+ end
18
+
19
+ def debug
20
+ Awestruct::Rack::Debug.new("")
21
+ end
22
+
23
+ def model
24
+ obj = ::Awestruct::Page.new({})
25
+ obj.A = {:a_one => 1, :a_two => 2}
26
+ obj.B = {:b_one => 1}
27
+ obj.C = {:c_one => [{:c_one_sub => 1}, {:c_two_sub => 2}]}
28
+ obj.CUST = {:obj => [TestObject.new('CUST_OBJ')]}
29
+ return obj
30
+ end
31
+
32
+ it "should include empty next level" do
33
+
34
+ struct = debug.introspect(model, {}, ['A'], depth = 3)
35
+
36
+ struct.size.should == 1
37
+ struct[:A].size.should == 0
38
+
39
+ end
40
+
41
+ it "should include next level on *" do
42
+
43
+ struct = debug.introspect(model, {}, ['*', 'A'], depth = 3)
44
+
45
+ struct.size.should == 1
46
+ struct[:A].size.should == 2
47
+ struct[:A][:a_one].should == 1
48
+ struct[:A][:a_two].should == 2
49
+
50
+ end
51
+
52
+ it "should include empty array on next level" do
53
+
54
+ struct = debug.introspect(model, {}, ['c_one', 'C'], depth = 3)
55
+
56
+ puts struct
57
+
58
+ struct.size.should == 1
59
+ struct[:C].size.should == 1
60
+ struct[:C][:c_one].size.should == 2
61
+ expect(struct[:C][:c_one][0]).to be_empty
62
+ expect(struct[:C][:c_one][1]).to be_empty
63
+
64
+ end
65
+
66
+ it "should include full array on next level" do
67
+
68
+ struct = debug.introspect(model, {}, ['*', 'c_one', 'C'], depth = 3)
69
+
70
+ puts struct
71
+
72
+ struct.size.should == 1
73
+ struct[:C].size.should == 1
74
+ struct[:C][:c_one].size.should == 2
75
+ expect(struct[:C][:c_one][0]).not_to be_empty
76
+ expect(struct[:C][:c_one][1]).not_to be_empty
77
+
78
+ end
79
+
80
+ it "should include array index on next level" do
81
+
82
+ struct = debug.introspect(model, {}, ['*', '1', 'c_one', 'C'], depth = 3)
83
+
84
+ puts struct
85
+
86
+ struct.size.should == 1
87
+ struct[:C].size.should == 1
88
+ struct[:C][:c_one].size.should == 2
89
+ expect(struct[:C][:c_one][0]).to be_empty
90
+ expect(struct[:C][:c_one][1]).not_to be_empty
91
+
92
+ end
93
+
94
+ it "should to_s custom objects" do
95
+
96
+ struct = debug.introspect(model, {}, ['*', 'obj', 'CUST'], depth = 3)
97
+
98
+ puts struct
99
+
100
+ struct.size.should == 1
101
+ struct[:CUST].size.should == 1
102
+ struct[:CUST][:obj].size.should == 1
103
+ expect(struct[:CUST][:obj][0]).not_to be_empty
104
+
105
+ end
106
+ end
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.5.6
4
+ version: 0.5.7.RC1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob McWhirter
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-08-28 00:00:00.000000000 Z
16
+ date: 2015-10-13 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  requirement: !ruby/object:Gem::Requirement
@@ -112,23 +112,23 @@ dependencies:
112
112
  - !ruby/object:Gem::Dependency
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '2.7'
118
115
  - - ">="
119
116
  - !ruby/object:Gem::Version
120
117
  version: 2.7.1
118
+ - - "<="
119
+ - !ruby/object:Gem::Version
120
+ version: '4.0'
121
121
  name: listen
122
122
  prerelease: false
123
123
  type: :runtime
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - "~>"
127
- - !ruby/object:Gem::Version
128
- version: '2.7'
129
126
  - - ">="
130
127
  - !ruby/object:Gem::Version
131
128
  version: 2.7.1
129
+ - - "<="
130
+ - !ruby/object:Gem::Version
131
+ version: '4.0'
132
132
  - !ruby/object:Gem::Dependency
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
@@ -214,7 +214,7 @@ dependencies:
214
214
  requirements:
215
215
  - - "~>"
216
216
  - !ruby/object:Gem::Version
217
- version: '0.3'
217
+ version: '1.3'
218
218
  name: oga
219
219
  prerelease: false
220
220
  type: :runtime
@@ -222,41 +222,7 @@ dependencies:
222
222
  requirements:
223
223
  - - "~>"
224
224
  - !ruby/object:Gem::Version
225
- version: '0.3'
226
- - !ruby/object:Gem::Dependency
227
- requirement: !ruby/object:Gem::Requirement
228
- requirements:
229
- - - "~>"
230
- - !ruby/object:Gem::Version
231
- version: '3.2'
232
- name: sass
233
- prerelease: false
234
- type: :runtime
235
- version_requirements: !ruby/object:Gem::Requirement
236
- requirements:
237
- - - "~>"
238
- - !ruby/object:Gem::Version
239
- version: '3.2'
240
- - !ruby/object:Gem::Dependency
241
- requirement: !ruby/object:Gem::Requirement
242
- requirements:
243
- - - "~>"
244
- - !ruby/object:Gem::Version
245
- version: '1'
246
- - - ">="
247
- - !ruby/object:Gem::Version
248
- version: 1.0.1
249
- name: compass
250
- prerelease: false
251
- type: :runtime
252
- version_requirements: !ruby/object:Gem::Requirement
253
- requirements:
254
- - - "~>"
255
- - !ruby/object:Gem::Version
256
- version: '1'
257
- - - ">="
258
- - !ruby/object:Gem::Version
259
- version: 1.0.1
225
+ version: '1.3'
260
226
  - !ruby/object:Gem::Dependency
261
227
  requirement: !ruby/object:Gem::Requirement
262
228
  requirements:
@@ -482,6 +448,7 @@ files:
482
448
  - lib/awestruct/handlers/string_handler.rb
483
449
  - lib/awestruct/handlers/template/asciidoc.rb
484
450
  - lib/awestruct/handlers/template/mustache.rb
451
+ - lib/awestruct/handlers/template/sassc.rb
485
452
  - lib/awestruct/handlers/tilt_handler.rb
486
453
  - lib/awestruct/handlers/verbatim_file_handler.rb
487
454
  - lib/awestruct/handlers/yaml_handler.rb
@@ -491,7 +458,9 @@ files:
491
458
  - lib/awestruct/page_loader.rb
492
459
  - lib/awestruct/pipeline.rb
493
460
  - lib/awestruct/rack/app.rb
461
+ - lib/awestruct/rack/debug.rb
494
462
  - lib/awestruct/rack/generate.rb
463
+ - lib/awestruct/rack/trace.html
495
464
  - lib/awestruct/scm/git.rb
496
465
  - lib/awestruct/site.rb
497
466
  - lib/awestruct/util/COPYING
@@ -544,6 +513,7 @@ files:
544
513
  - spec/awestruct/page_loader_spec.rb
545
514
  - spec/awestruct/pipeline_spec.rb
546
515
  - spec/awestruct/rack/app_spec.rb
516
+ - spec/awestruct/rack/debug_spec.rb
547
517
  - spec/awestruct/scm/git_spec.rb
548
518
  - spec/spec_helper.rb
549
519
  - spec/support/awestruct_setup.rb
@@ -661,16 +631,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
661
631
  requirements:
662
632
  - - ">="
663
633
  - !ruby/object:Gem::Version
664
- version: '0'
634
+ version: '2.0'
665
635
  required_rubygems_version: !ruby/object:Gem::Requirement
666
636
  requirements:
667
- - - ">="
637
+ - - ">"
668
638
  - !ruby/object:Gem::Version
669
- version: '0'
639
+ version: 1.3.1
670
640
  requirements:
671
641
  - |
672
642
  Any markup languages you are using and its dependencies.
673
- 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.'
643
+ 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.
644
+ 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.
674
645
  rubyforge_project: awestruct
675
646
  rubygems_version: 2.4.8
676
647
  signing_key:
@@ -720,4 +691,5 @@ test_files:
720
691
  - spec/awestruct/page_loader_spec.rb
721
692
  - spec/awestruct/pipeline_spec.rb
722
693
  - spec/awestruct/rack/app_spec.rb
694
+ - spec/awestruct/rack/debug_spec.rb
723
695
  - spec/awestruct/scm/git_spec.rb