hoshi 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +1 -4
- data/Rakefile +1 -1
- data/lib/hoshi/monkey_patches.rb +6 -13
- data/lib/hoshi/view.rb +1 -5
- metadata +3 -4
- data/lib/hoshi/view-tag-fallback.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 783544e05672de686759ab07a25195238ab6c52c
|
4
|
+
data.tar.gz: e50b0f09a495af1e2741fb38f693d2989ce4f52d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16d0bef7793652ffc80b0c6e2d4830d60c742e44e2e3a88026950d081703485b703bead988d1e2e8e5febb75d79920ef239f4451bfc59452f879b6e8cbdefbf
|
7
|
+
data.tar.gz: 1c27598f70ef353fd456b9fff8a64857f4a3b7cfdbfb216bedebda93315bc2f59e7e22ad1a61662d23e92ff07eba09ed01822547c551441a882d285b19130e8f
|
data/README
CHANGED
@@ -184,10 +184,7 @@ AT&T Interactive.
|
|
184
184
|
Also, I guess I should credit Attractive Eighties Women
|
185
185
|
(http://attractiveeightieswomen.com/), since I was blasting them the
|
186
186
|
whole time I was developing this. Like, over and over. I couldn't stop
|
187
|
-
listening.
|
188
|
-
that I am yet ready to take the first step by admitting there is a
|
189
|
-
problem. Intervention may be required. This paragraph should probably
|
190
|
-
be considered a cry for help.
|
187
|
+
listening.
|
191
188
|
|
192
189
|
== Home page
|
193
190
|
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ spec = Gem::Specification.new { |s|
|
|
20
20
|
s.summary = "Nice, object-oriented, first-class views."
|
21
21
|
s.homepage = "http://debu.gs/#{s.name}"
|
22
22
|
%w(metaid hpricot).each &s.method(:add_dependency)
|
23
|
-
s.version = '1.0.
|
23
|
+
s.version = '1.0.2'
|
24
24
|
}
|
25
25
|
|
26
26
|
Gem::PackageTask.new(spec) { |pkg|
|
data/lib/hoshi/monkey_patches.rb
CHANGED
@@ -1,24 +1,17 @@
|
|
1
|
+
# TODO: When 1.9 goes away, monkey-patching should be changed to refinements.
|
2
|
+
# See: http://blog.headius.com/2012/11/refining-ruby.html
|
3
|
+
|
1
4
|
class Hash
|
2
5
|
# Makes this hash fit to be put into a tag.
|
3
|
-
# {
|
6
|
+
# {a: 1, b: "two", c: true}.to_html_options # => 'a="one" b="two" c'
|
4
7
|
def to_html_options double_quotes = true
|
5
8
|
qchar = double_quotes ? '"' : "'"
|
6
9
|
map { |k,v|
|
7
|
-
if v == true
|
10
|
+
if v == true # Intentional.
|
8
11
|
k.to_s
|
9
12
|
else
|
10
|
-
"#{k}=#{qchar}#{v}#{qchar}"
|
13
|
+
"#{k}=#{qchar}#{v.to_s.gsub(qchar, CGI.escapeHTML(qchar))}#{qchar}"
|
11
14
|
end
|
12
15
|
}.join(' ')
|
13
16
|
end
|
14
17
|
end
|
15
|
-
|
16
|
-
# We've dropped facets, and are now shooting for compatibility across Ruby
|
17
|
-
# versions, so we add Symbol#to_proc unless it exists.
|
18
|
-
unless((Symbol.instance_method(:to_proc) rescue nil))
|
19
|
-
class Symbol
|
20
|
-
def to_proc
|
21
|
-
proc { |obj, *args| obj.send(self, *args) }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/lib/hoshi/view.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoshi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Elmore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metaid
|
@@ -50,7 +50,6 @@ files:
|
|
50
50
|
- lib/html2hoshi.rb
|
51
51
|
- lib/hoshi/view.rb
|
52
52
|
- lib/hoshi/tag.rb
|
53
|
-
- lib/hoshi/view-tag-fallback.rb
|
54
53
|
- lib/hoshi/view/xhtml1.rb
|
55
54
|
- lib/hoshi/view/html.rb
|
56
55
|
- lib/hoshi/view/html4.rb
|
@@ -97,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
96
|
version: '0'
|
98
97
|
requirements: []
|
99
98
|
rubyforge_project: hoshi-view
|
100
|
-
rubygems_version: 2.0.
|
99
|
+
rubygems_version: 2.0.14
|
101
100
|
signing_key:
|
102
101
|
specification_version: 4
|
103
102
|
summary: Nice, object-oriented, first-class views.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Hoshi
|
2
|
-
class View
|
3
|
-
# This method is a fallback for pre-1.8.7 Ruby; if a syntax error is
|
4
|
-
# encountered when hoshi/view.rb tries to load hoshi/view-tag.rb, this
|
5
|
-
# file is loaded. I have really been trying to avoid eval()ing strings
|
6
|
-
# (for religious reasons), but have to make this concession.
|
7
|
-
def self.tag(name, close_type = nil)
|
8
|
-
class_eval <<-EOHACK
|
9
|
-
def #{name}(*opts, &b)
|
10
|
-
if b
|
11
|
-
tag #{name.inspect}, #{close_type.inspect}, *opts, &b
|
12
|
-
else
|
13
|
-
tag #{name.inspect}, #{close_type.inspect}, *opts
|
14
|
-
end
|
15
|
-
end
|
16
|
-
EOHACK
|
17
|
-
# Inline tags.
|
18
|
-
define_method("_#{name}") { |*opts| _tag name, close_type, *opts }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|