hoshi 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d94fffbfa325feff79de2aa56200eabbb6b6cd3f
4
- data.tar.gz: ea241fff24e0384e17ee484a25ae8b2ce0c7bee3
3
+ metadata.gz: 783544e05672de686759ab07a25195238ab6c52c
4
+ data.tar.gz: e50b0f09a495af1e2741fb38f693d2989ce4f52d
5
5
  SHA512:
6
- metadata.gz: e28120927da5cd877dae48cd6c2df0ac23f27525af4927337b6240720c53b4f695f71c21934981048fce6ec954671ccbd80168d4ef7363c3155af03556b8cf2c
7
- data.tar.gz: 275632c8f6190be96e463cc3f4318c52f0ededd275691e7db76e37fc6a06e804f020f13e230bc8c9de7af36371ceb6fab4c769f1b055253344c39b321734b71b
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. My friends and family are becoming concerned. I don't feel
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.1'
23
+ s.version = '1.0.2'
24
24
  }
25
25
 
26
26
  Gem::PackageTask.new(spec) { |pkg|
@@ -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
- # { :a => 1, :b => "two", :c => true }.to_html_options # => 'a="one" b="two" c'
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
@@ -1,11 +1,7 @@
1
1
  require 'metaid'
2
2
  require 'cgi'
3
3
 
4
- begin
5
- require 'hoshi/view-tag'
6
- rescue SyntaxError
7
- require 'hoshi/view-tag-fallback'
8
- end
4
+ require 'hoshi/view-tag'
9
5
 
10
6
  module Hoshi
11
7
  # The View class is the super-class for views you create with Hoshi. More
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.1
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-09-23 00:00:00.000000000 Z
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.3
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