Skip to content

Commit 1497533

Browse files
committed
some cleanup
- removes/renames HammerBuilder references - fixes in readme
1 parent f07b97e commit 1497533

File tree

7 files changed

+16
-33
lines changed

7 files changed

+16
-33
lines changed

README_FULL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Htmless::Formatted.new.go_in do
1515
head { title 'my_page' }
1616
body do
1717
div id: :content do
18-
p.centered "my page's content"
18+
p "my page's content"
1919
end
2020
end
2121
end
@@ -340,7 +340,7 @@ If they are needed they can be mixed directly into Builder's instance
340340
Or new builder descendant can be made.
341341

342342
!!!ruby
343-
class MyBuilder < Hammer::FormattedBuilder
343+
class MyBuilder < Htmless::FormattedBuilder
344344
include ActionView::Helpers::NumberHelper
345345
end
346346

lib/copy_to_doc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
end
4949

5050
#out << " class AbstractTag\n" ff
51-
#HammerBuilder::GLOBAL_ATTRIBUTES.each do |attr|
51+
#Htmless::GLOBAL_ATTRIBUTES.each do |attr|
5252
# out << " \#@method #{attr}(value)\n"
5353
# out << " attribute :#{attr}\n"
5454
#end

lib/htmless/abstract.rb

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# USA
1818

1919
require 'cgi'
20-
#require 'active_support/core_ext/string/inflections'
2120

2221
require 'htmless/dynamic_classes'
2322
require 'htmless/strings_injector'
@@ -101,7 +100,7 @@ def #{tag}(*args, &block)
101100

102101

103102
# creates a new builder
104-
# This is quite expensive, HammerBuilder::Pool should be used
103+
# This is quite expensive, Htmless::Pool should be used
105104
def initialize()
106105
@_output = ""
107106
@_stack = []
@@ -115,6 +114,10 @@ def initialize()
115114
end
116115
end
117116

117+
def inspect
118+
%Q{<Htmless::Abstract >}
119+
end
120+
118121
# escapes +text+ to output
119122
def text(text)
120123
flush
@@ -154,22 +157,9 @@ def reset
154157
self
155158
end
156159

157-
#def capture
158-
# flush
159-
# _output = @_output.clone
160-
# _stack = @_stack.clone
161-
# @_output.clear
162-
# @_stack.clear
163-
# yield
164-
# to_html
165-
#ensure
166-
# @_output.replace _output
167-
# @_stack.replace _stack
168-
#end
169-
170160
# enables you to evaluate +block+ inside the builder with +variables+
171161
# @example
172-
# HammerBuilder::Formatted.new.go_in('asd') do |string|
162+
# Htmless::Formatted.new.go_in('asd') do |string|
173163
# div string
174164
# end.to_html #=> "<div>asd</div>"
175165
#

lib/htmless/data/html5.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,5 @@ module Data
188188
Attribute.new(attr.to_sym, attribute_type[name, attr])
189189
end)
190190
end)
191-
192-
#require 'pp'
193-
#pp HTML5
194-
#pp HTML5.abstract_attributes
195-
#pp HTML5.simple_tags
196191
end
197192
end

lib/htmless/helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ module Helper
2525
# @example
2626
# class User
2727
# # ...
28-
# include HammerBuilder::Helper
28+
# include Htmless::Helper
2929
#
3030
# builder :menu do |user|
3131
# li user.name
3232
# end
3333
# end
3434
#
35-
# User.new.menu(HammerBuilder::Standard.get).to_html! #=> "<li>Name</li>"
35+
# User.new.menu(Htmless::Standard.get).to_html! #=> "<li>Name</li>"
3636
def builder(method_name, &builder_block)
3737
define_method(method_name) do |builder, *args|
3838
builder.dive(self, *args, &builder_block)

lib/htmless/pool.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Htmless
2323
# pool = Pool.new Formatted
2424
# pool.get.go_in do
2525
# # some rendering
26-
# end.to_xhtml! # => output and releases the builder to pool
26+
# end.to_html! # => output and releases the builder to pool
2727
class Pool
2828

2929
module Helper
@@ -47,6 +47,10 @@ def initialize(klass)
4747
klass.send :include, Helper
4848
end
4949

50+
def inspect
51+
%Q{<Htmless::Pool klass={@klass} #{self.__id__}>}
52+
end
53+
5054
# This the preferred way of getting new Builder. If you forget to release it, it does not matter -
5155
# builder gets GCed after you lose reference
5256
# @return [Abstract]

lib/htmless/rails.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,4 @@ def initialize(controller)
4949
go_in { render obj, "#{options[:method] || options[:template]}" }.to_html!,
5050
:layout => true)
5151
end
52-
53-
5452
end
55-
56-
57-
58-

0 commit comments

Comments
 (0)