sinatra-bells 0.3.0 → 0.4.0
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 +4 -4
- data/ChangeLog +5 -0
- data/README +1 -1
- data/lib/sinatra/bells.rb +3 -3
- data/lib/sinatra/bells/helpers/view.rb +15 -3
- data/lib/sinatra/bells/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c06a119e890338c06263a4ff633d48408783cb3
|
4
|
+
data.tar.gz: 0caaea6341e20b1525125caaafa6562613a2aa54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8582be5383ef42c876b695810905a058df03bfefb82b03e57841c67fefd9028707712f7876663c68bdb1bc3f1d611dace8773b075de8e0d5fce6856456351b2
|
7
|
+
data.tar.gz: a0e5f7574fd1c043bc8d67ed4141b0f2a2feb52933bad982756f5b422a64503b1c7cc5742725ee82457a1d6a8c8111e347e903a3a96c726c492ae7120e00db84
|
data/ChangeLog
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
= Revision history for sinatra-bells
|
4
4
|
|
5
|
+
== 0.4.0 [2016-06-06]
|
6
|
+
|
7
|
+
* Prevent Sinatra's hash merge behaviour in Sinatra::Bells.set.
|
8
|
+
* Added Sinatra::Bells::Helpers::View#tag__ and HTML element helpers.
|
9
|
+
|
5
10
|
== 0.3.0 [2016-01-28]
|
6
11
|
|
7
12
|
* Added Sinatra::Bells::Helpers::View#partial.
|
data/README
CHANGED
data/lib/sinatra/bells.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# #
|
6
6
|
# sinatra-bells -- Sinatra with some more bells and whistles #
|
7
7
|
# #
|
8
|
-
# Copyright (C) 2014-
|
8
|
+
# Copyright (C) 2014-2016 Jens Wille #
|
9
9
|
# #
|
10
10
|
# Authors: #
|
11
11
|
# Jens Wille <jens.wille@gmail.com> #
|
@@ -35,9 +35,9 @@ module Sinatra
|
|
35
35
|
class << self
|
36
36
|
|
37
37
|
def set(option, *args, &block)
|
38
|
-
block ?
|
38
|
+
block ? args.empty? ? set_defer(option, &block) :
|
39
39
|
raise(ArgumentError, 'both block and arguments given') :
|
40
|
-
|
40
|
+
(set(option, nil) if args.first.is_a?(Hash); super(option, *args))
|
41
41
|
end
|
42
42
|
|
43
43
|
def set_defer(option, &block)
|
@@ -68,6 +68,10 @@ class Sinatra::Bells
|
|
68
68
|
def #{name}_(*args, &block)
|
69
69
|
tag_(#{name.inspect}, *args, &block)
|
70
70
|
end
|
71
|
+
|
72
|
+
def #{name}__(*args)
|
73
|
+
tag__(#{name.inspect}, *args)
|
74
|
+
end
|
71
75
|
EOT
|
72
76
|
}
|
73
77
|
end
|
@@ -86,6 +90,10 @@ class Sinatra::Bells
|
|
86
90
|
|
87
91
|
tag_(#{name.inspect}, *args, &block)
|
88
92
|
end
|
93
|
+
|
94
|
+
def #{name}__(*args)
|
95
|
+
tag__(#{name.inspect}, *args)
|
96
|
+
end
|
89
97
|
EOT
|
90
98
|
}
|
91
99
|
end
|
@@ -120,6 +128,12 @@ class Sinatra::Bells
|
|
120
128
|
end
|
121
129
|
|
122
130
|
def tag_(name, *args)
|
131
|
+
tag__(name, *args)
|
132
|
+
yield args if block_given?
|
133
|
+
args.push('</', name, '>').join
|
134
|
+
end
|
135
|
+
|
136
|
+
def tag__(name, *args)
|
123
137
|
args.unshift('<', name, '>')
|
124
138
|
|
125
139
|
if args.last.is_a?(Hash)
|
@@ -127,9 +141,7 @@ class Sinatra::Bells
|
|
127
141
|
args.insert(2, ' ', attr.join(' ')) unless attr.empty?
|
128
142
|
end
|
129
143
|
|
130
|
-
|
131
|
-
|
132
|
-
args.push('</', name, '>').join
|
144
|
+
args.join
|
133
145
|
end
|
134
146
|
|
135
147
|
define_html_tag_method(*HTML_ELEMENTS)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-bells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0.8'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.8.
|
36
|
+
version: 0.8.5
|
37
37
|
type: :development
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0.8'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.8.
|
46
|
+
version: 0.8.5
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,13 +83,14 @@ licenses:
|
|
83
83
|
metadata: {}
|
84
84
|
post_install_message: |2+
|
85
85
|
|
86
|
-
sinatra-bells-0.
|
86
|
+
sinatra-bells-0.4.0 [2016-06-06]:
|
87
87
|
|
88
|
-
*
|
88
|
+
* Prevent Sinatra's hash merge behaviour in Sinatra::Bells.set.
|
89
|
+
* Added Sinatra::Bells::Helpers::View#tag__ and HTML element helpers.
|
89
90
|
|
90
91
|
rdoc_options:
|
91
92
|
- "--title"
|
92
|
-
- sinatra-bells Application documentation (v0.
|
93
|
+
- sinatra-bells Application documentation (v0.4.0)
|
93
94
|
- "--charset"
|
94
95
|
- UTF-8
|
95
96
|
- "--line-numbers"
|
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
111
|
version: '0'
|
111
112
|
requirements: []
|
112
113
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.6.4
|
114
115
|
signing_key:
|
115
116
|
specification_version: 4
|
116
117
|
summary: Sinatra with some more bells and whistles.
|