mack-haml 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/lib/gems.rb +13 -0
  2. data/lib/gems/haml-2.0.4/VERSION +1 -0
  3. data/lib/gems/haml-2.0.4/bin/css2sass +7 -0
  4. data/lib/gems/haml-2.0.4/bin/haml +9 -0
  5. data/lib/gems/haml-2.0.4/bin/html2haml +7 -0
  6. data/lib/gems/haml-2.0.4/bin/sass +8 -0
  7. data/lib/gems/haml-2.0.4/lib/haml.rb +1040 -0
  8. data/lib/gems/haml-2.0.4/lib/haml/buffer.rb +239 -0
  9. data/lib/gems/haml-2.0.4/lib/haml/engine.rb +265 -0
  10. data/lib/gems/haml-2.0.4/lib/haml/error.rb +22 -0
  11. data/lib/gems/haml-2.0.4/lib/haml/exec.rb +364 -0
  12. data/lib/gems/haml-2.0.4/lib/haml/filters.rb +275 -0
  13. data/lib/gems/haml-2.0.4/lib/haml/helpers.rb +453 -0
  14. data/lib/gems/haml-2.0.4/lib/haml/helpers/action_view_extensions.rb +45 -0
  15. data/lib/gems/haml-2.0.4/lib/haml/helpers/action_view_mods.rb +179 -0
  16. data/lib/gems/haml-2.0.4/lib/haml/html.rb +227 -0
  17. data/lib/gems/haml-2.0.4/lib/haml/precompiler.rb +805 -0
  18. data/lib/gems/haml-2.0.4/lib/haml/template.rb +51 -0
  19. data/lib/gems/haml-2.0.4/lib/haml/template/patch.rb +58 -0
  20. data/lib/gems/haml-2.0.4/lib/haml/template/plugin.rb +72 -0
  21. data/lib/gems/haml-2.0.4/lib/sass.rb +863 -0
  22. data/lib/gems/haml-2.0.4/lib/sass/constant.rb +214 -0
  23. data/lib/gems/haml-2.0.4/lib/sass/constant/color.rb +101 -0
  24. data/lib/gems/haml-2.0.4/lib/sass/constant/literal.rb +54 -0
  25. data/lib/gems/haml-2.0.4/lib/sass/constant/nil.rb +9 -0
  26. data/lib/gems/haml-2.0.4/lib/sass/constant/number.rb +87 -0
  27. data/lib/gems/haml-2.0.4/lib/sass/constant/operation.rb +30 -0
  28. data/lib/gems/haml-2.0.4/lib/sass/constant/string.rb +22 -0
  29. data/lib/gems/haml-2.0.4/lib/sass/css.rb +394 -0
  30. data/lib/gems/haml-2.0.4/lib/sass/engine.rb +466 -0
  31. data/lib/gems/haml-2.0.4/lib/sass/error.rb +35 -0
  32. data/lib/gems/haml-2.0.4/lib/sass/plugin.rb +169 -0
  33. data/lib/gems/haml-2.0.4/lib/sass/plugin/merb.rb +56 -0
  34. data/lib/gems/haml-2.0.4/lib/sass/plugin/rails.rb +24 -0
  35. data/lib/gems/haml-2.0.4/lib/sass/tree/attr_node.rb +53 -0
  36. data/lib/gems/haml-2.0.4/lib/sass/tree/comment_node.rb +20 -0
  37. data/lib/gems/haml-2.0.4/lib/sass/tree/directive_node.rb +46 -0
  38. data/lib/gems/haml-2.0.4/lib/sass/tree/node.rb +42 -0
  39. data/lib/gems/haml-2.0.4/lib/sass/tree/rule_node.rb +89 -0
  40. data/lib/gems/haml-2.0.4/lib/sass/tree/value_node.rb +16 -0
  41. data/lib/gems/haml-2.0.4/rails/init.rb +1 -0
  42. data/lib/mack-haml.rb +1 -0
  43. metadata +65 -16
@@ -0,0 +1,89 @@
1
+ require 'sass/tree/node'
2
+ require 'sass/tree/attr_node'
3
+
4
+ module Sass::Tree
5
+ class RuleNode < ValueNode
6
+ # The character used to include the parent selector
7
+ PARENT = '&'
8
+
9
+ alias_method :rule, :value
10
+ alias_method :rule=, :value=
11
+
12
+ def rules
13
+ Array(rule)
14
+ end
15
+
16
+ def add_rules(node)
17
+ self.rule = rules
18
+ self.rule += node.rules
19
+ end
20
+
21
+ def continued?
22
+ rule[-1] == ?,
23
+ end
24
+
25
+ def to_s(tabs, super_rules = nil)
26
+ attributes = []
27
+ sub_rules = []
28
+
29
+ rule_split = /\s*,\s*/
30
+ rule_separator = @style == :compressed ? ',' : ', '
31
+ line_separator = [:nested, :expanded].include?(@style) ? ",\n" : rule_separator
32
+ rule_indent = ' ' * (tabs - 1)
33
+ total_rule = if super_rules
34
+ super_rules.split(",\n").map do |super_line|
35
+ super_line.strip.split(rule_split).map do |super_rule|
36
+ self.rules.map do |line|
37
+ rule_indent + line.gsub(/,$/, '').split(rule_split).map do |rule|
38
+ if rule.include?(PARENT)
39
+ rule.gsub(PARENT, super_rule)
40
+ else
41
+ "#{super_rule} #{rule}"
42
+ end
43
+ end.join(rule_separator)
44
+ end.join(line_separator)
45
+ end.join(rule_separator)
46
+ end.join(line_separator)
47
+ elsif self.rules.any? { |r| r.include?(PARENT) }
48
+ raise Sass::SyntaxError.new("Base-level rules cannot contain the parent-selector-referencing character '#{PARENT}'.", line)
49
+ else
50
+ per_rule_indent, total_indent = [:nested, :expanded].include?(@style) ? [rule_indent, ''] : ['', rule_indent]
51
+ total_indent + self.rules.map do |r|
52
+ per_rule_indent + r.gsub(/,$/, '').gsub(rule_split, rule_separator).rstrip
53
+ end.join(line_separator)
54
+ end
55
+
56
+ children.each do |child|
57
+ if child.is_a? RuleNode
58
+ sub_rules << child
59
+ else
60
+ attributes << child
61
+ end
62
+ end
63
+
64
+ to_return = ''
65
+ if !attributes.empty?
66
+ old_spaces = ' ' * (tabs - 1)
67
+ spaces = ' ' * tabs
68
+ if @style == :compact
69
+ attributes = attributes.map { |a| a.to_s(1) }.join(' ')
70
+ to_return << "#{total_rule} { #{attributes} }\n"
71
+ elsif @style == :compressed
72
+ attributes = attributes.map { |a| a.to_s(1) }.join(';')
73
+ to_return << "#{total_rule}{#{attributes}}"
74
+ else
75
+ attributes = attributes.map { |a| a.to_s(tabs + 1) }.join("\n")
76
+ end_attrs = (@style == :expanded ? "\n" + old_spaces : ' ')
77
+ to_return << "#{total_rule} {\n#{attributes}#{end_attrs}}\n"
78
+ end
79
+ end
80
+
81
+ tabs += 1 unless attributes.empty? || @style != :nested
82
+ sub_rules.each do |sub|
83
+ to_return << sub.to_s(tabs, total_rule)
84
+ end
85
+
86
+ to_return
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,16 @@
1
+ require 'sass/tree/node'
2
+
3
+ module Sass::Tree
4
+ class ValueNode < Node
5
+ attr_accessor :value
6
+
7
+ def initialize(value, style)
8
+ @value = value
9
+ super(style)
10
+ end
11
+
12
+ def to_s(tabs = 0)
13
+ value
14
+ end
15
+ end
16
+ end
@@ -0,0 +1 @@
1
+ Kernel.load File.join(File.dirname(__FILE__), '..', 'init.rb')
data/lib/mack-haml.rb CHANGED
@@ -1,2 +1,3 @@
1
+ require File.join(File.dirname(__FILE__), 'gems')
1
2
  require 'haml'
2
3
  require File.join(File.dirname(__FILE__), "mack-haml", 'haml_engine')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mack-haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darsono Sutedja
@@ -9,19 +9,10 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-26 00:00:00 -04:00
12
+ date: 2008-11-30 00:00:00 -05:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: haml
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - "="
22
- - !ruby/object:Gem::Version
23
- version: 2.0.2
24
- version:
14
+ dependencies: []
15
+
25
16
  description: Haml Rendering Engine for Mack Framework
26
17
  email: darsono.sutedja@gmail.com
27
18
  executables: []
@@ -31,14 +22,72 @@ extensions: []
31
22
  extra_rdoc_files: []
32
23
 
33
24
  files:
25
+ - lib/gems
26
+ - lib/gems/cache
27
+ - lib/gems/doc
28
+ - lib/gems/gems
29
+ - lib/gems/haml-2.0.4
30
+ - lib/gems/haml-2.0.4/bin
31
+ - lib/gems/haml-2.0.4/bin/css2sass
32
+ - lib/gems/haml-2.0.4/bin/haml
33
+ - lib/gems/haml-2.0.4/bin/html2haml
34
+ - lib/gems/haml-2.0.4/bin/sass
35
+ - lib/gems/haml-2.0.4/lib
36
+ - lib/gems/haml-2.0.4/lib/haml
37
+ - lib/gems/haml-2.0.4/lib/haml/buffer.rb
38
+ - lib/gems/haml-2.0.4/lib/haml/engine.rb
39
+ - lib/gems/haml-2.0.4/lib/haml/error.rb
40
+ - lib/gems/haml-2.0.4/lib/haml/exec.rb
41
+ - lib/gems/haml-2.0.4/lib/haml/filters.rb
42
+ - lib/gems/haml-2.0.4/lib/haml/helpers
43
+ - lib/gems/haml-2.0.4/lib/haml/helpers/action_view_extensions.rb
44
+ - lib/gems/haml-2.0.4/lib/haml/helpers/action_view_mods.rb
45
+ - lib/gems/haml-2.0.4/lib/haml/helpers.rb
46
+ - lib/gems/haml-2.0.4/lib/haml/html.rb
47
+ - lib/gems/haml-2.0.4/lib/haml/precompiler.rb
48
+ - lib/gems/haml-2.0.4/lib/haml/template
49
+ - lib/gems/haml-2.0.4/lib/haml/template/patch.rb
50
+ - lib/gems/haml-2.0.4/lib/haml/template/plugin.rb
51
+ - lib/gems/haml-2.0.4/lib/haml/template.rb
52
+ - lib/gems/haml-2.0.4/lib/haml.rb
53
+ - lib/gems/haml-2.0.4/lib/sass
54
+ - lib/gems/haml-2.0.4/lib/sass/constant
55
+ - lib/gems/haml-2.0.4/lib/sass/constant/color.rb
56
+ - lib/gems/haml-2.0.4/lib/sass/constant/literal.rb
57
+ - lib/gems/haml-2.0.4/lib/sass/constant/nil.rb
58
+ - lib/gems/haml-2.0.4/lib/sass/constant/number.rb
59
+ - lib/gems/haml-2.0.4/lib/sass/constant/operation.rb
60
+ - lib/gems/haml-2.0.4/lib/sass/constant/string.rb
61
+ - lib/gems/haml-2.0.4/lib/sass/constant.rb
62
+ - lib/gems/haml-2.0.4/lib/sass/css.rb
63
+ - lib/gems/haml-2.0.4/lib/sass/engine.rb
64
+ - lib/gems/haml-2.0.4/lib/sass/error.rb
65
+ - lib/gems/haml-2.0.4/lib/sass/plugin
66
+ - lib/gems/haml-2.0.4/lib/sass/plugin/merb.rb
67
+ - lib/gems/haml-2.0.4/lib/sass/plugin/rails.rb
68
+ - lib/gems/haml-2.0.4/lib/sass/plugin.rb
69
+ - lib/gems/haml-2.0.4/lib/sass/tree
70
+ - lib/gems/haml-2.0.4/lib/sass/tree/attr_node.rb
71
+ - lib/gems/haml-2.0.4/lib/sass/tree/comment_node.rb
72
+ - lib/gems/haml-2.0.4/lib/sass/tree/directive_node.rb
73
+ - lib/gems/haml-2.0.4/lib/sass/tree/node.rb
74
+ - lib/gems/haml-2.0.4/lib/sass/tree/rule_node.rb
75
+ - lib/gems/haml-2.0.4/lib/sass/tree/value_node.rb
76
+ - lib/gems/haml-2.0.4/lib/sass.rb
77
+ - lib/gems/haml-2.0.4/rails
78
+ - lib/gems/haml-2.0.4/rails/init.rb
79
+ - lib/gems/haml-2.0.4/VERSION
80
+ - lib/gems/specifications
81
+ - lib/gems.rb
82
+ - lib/mack-haml
34
83
  - lib/mack-haml/haml_engine.rb
35
84
  - lib/mack-haml.rb
36
85
  - README
37
86
  has_rdoc: true
38
87
  homepage: http://www.mackframework.com
39
88
  post_install_message:
40
- rdoc_options: []
41
-
89
+ rdoc_options:
90
+ - --exclude=gems/
42
91
  require_paths:
43
92
  - lib
44
93
  - lib
@@ -57,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
106
  requirements: []
58
107
 
59
108
  rubyforge_project: magrathea
60
- rubygems_version: 1.2.0
109
+ rubygems_version: 1.3.1
61
110
  signing_key:
62
111
  specification_version: 2
63
112
  summary: Rendering Engine