sinatra-sugar 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +27 -0
- data/README.md +0 -4
- data/lib/sinatra/sugar.rb +2 -7
- data/spec/sinatra/sugar_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +26 -13
data/LICENSE
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
copyright (c) 2010 Konstantin Haase. All rights reserved.
|
2
|
+
|
3
|
+
Developed by: Konstantin Haase
|
4
|
+
http://github.com/rkh/big_band
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to
|
8
|
+
deal with the Software without restriction, including without limitation the
|
9
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
1. Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimers.
|
14
|
+
2. Redistributions in binary form must reproduce the above copyright
|
15
|
+
notice, this list of conditions and the following disclaimers in the
|
16
|
+
documentation and/or other materials provided with the distribution.
|
17
|
+
3. Neither the name of Konstantin Haase, nor the names of other contributors
|
18
|
+
may be used to endorse or promote products derived from this Software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
27
|
+
WITH THE SOFTWARE.
|
data/README.md
CHANGED
@@ -26,10 +26,6 @@ More advanced set
|
|
26
26
|
set :haml, :format => :html5, :escape_html => true
|
27
27
|
set :haml, :excape_html => false
|
28
28
|
haml # => { :format => :html5, :escape_html => false }
|
29
|
-
|
30
|
-
- Allows passing a block in Sinatra 0.9, too:
|
31
|
-
|
32
|
-
set(:foo) { Time.now }
|
33
29
|
|
34
30
|
More advanced register
|
35
31
|
----------------------
|
data/lib/sinatra/sugar.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "sinatra/base"
|
2
|
-
require "monkey"
|
2
|
+
require "monkey-lib"
|
3
3
|
|
4
4
|
module Sinatra
|
5
5
|
module Sugar
|
@@ -37,15 +37,10 @@ module Sinatra
|
|
37
37
|
# - Allowes passing a block (for Sinatra 0.9.x):
|
38
38
|
# set(:foo) { Time.now }
|
39
39
|
def set(key, value = self, &block)
|
40
|
-
# FIXME: refactor, refactor, refactor
|
41
|
-
if block_given? and Sinatra::VERSION < "1.0"
|
42
|
-
raise ArgumentError, "both a value and a block given" if value != self
|
43
|
-
value = block
|
44
|
-
end
|
45
40
|
symbolized = (key.to_sym if key.respond_to? :to_sym)
|
46
41
|
old_value = (send(symbolized) if symbolized and respond_to? symbolized)
|
47
42
|
value = old_value.merge value if value.is_a? Hash and old_value.is_a? Hash
|
48
|
-
super
|
43
|
+
super
|
49
44
|
# HACK: Sinatra::Base.set uses recursion and in the final step value always
|
50
45
|
# is a Proc. Also, if value is a Proc no step ever follows. I abuse this to
|
51
46
|
# invoke the hooks only once per set.
|
data/spec/sinatra/sugar_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require "sinatra/rspec"
|
1
|
+
require "sinatra/rspec/shared"
|
2
2
|
require "sinatra/sugar"
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-sugar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 11
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Konstantin Haase
|
@@ -14,58 +15,65 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-07-09 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: monkey-lib
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ~>
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 11
|
27
30
|
segments:
|
28
31
|
- 0
|
29
|
-
-
|
32
|
+
- 5
|
30
33
|
- 0
|
31
|
-
version: 0.
|
34
|
+
version: 0.5.0
|
32
35
|
type: :runtime
|
33
36
|
version_requirements: *id001
|
34
37
|
- !ruby/object:Gem::Dependency
|
35
38
|
name: sinatra-test-helper
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ~>
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 11
|
41
46
|
segments:
|
42
47
|
- 0
|
43
|
-
-
|
48
|
+
- 5
|
44
49
|
- 0
|
45
|
-
version: 0.
|
50
|
+
version: 0.5.0
|
46
51
|
type: :development
|
47
52
|
version_requirements: *id002
|
48
53
|
- !ruby/object:Gem::Dependency
|
49
54
|
name: sinatra
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
|
-
- -
|
59
|
+
- - ~>
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 15
|
55
62
|
segments:
|
63
|
+
- 1
|
56
64
|
- 0
|
57
|
-
|
58
|
-
- 4
|
59
|
-
version: 0.9.4
|
65
|
+
version: "1.0"
|
60
66
|
type: :runtime
|
61
67
|
version_requirements: *id003
|
62
68
|
- !ruby/object:Gem::Dependency
|
63
69
|
name: rspec
|
64
70
|
prerelease: false
|
65
71
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
66
73
|
requirements:
|
67
74
|
- - ">="
|
68
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 27
|
69
77
|
segments:
|
70
78
|
- 1
|
71
79
|
- 3
|
@@ -86,6 +94,7 @@ files:
|
|
86
94
|
- spec/sinatra/sugar_spec.rb
|
87
95
|
- spec/spec_helper.rb
|
88
96
|
- README.md
|
97
|
+
- LICENSE
|
89
98
|
has_rdoc: yard
|
90
99
|
homepage: http://github.com/rkh/sinatra-sugar
|
91
100
|
licenses: []
|
@@ -96,23 +105,27 @@ rdoc_options: []
|
|
96
105
|
require_paths:
|
97
106
|
- lib
|
98
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
99
109
|
requirements:
|
100
110
|
- - ">="
|
101
111
|
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
102
113
|
segments:
|
103
114
|
- 0
|
104
115
|
version: "0"
|
105
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
106
118
|
requirements:
|
107
119
|
- - ">="
|
108
120
|
- !ruby/object:Gem::Version
|
121
|
+
hash: 3
|
109
122
|
segments:
|
110
123
|
- 0
|
111
124
|
version: "0"
|
112
125
|
requirements: []
|
113
126
|
|
114
127
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.3.
|
128
|
+
rubygems_version: 1.3.7
|
116
129
|
signing_key:
|
117
130
|
specification_version: 3
|
118
131
|
summary: Some extensions to the sinatra default behavior (usefull for other Sintatra extensions, part of BigBand).
|