sinatra-sugar 0.4.0.b → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -4
- data/lib/sinatra/sugar.rb +1 -1
- data/lib/sinatra/sugar/outstanding_patches.rb +6 -0
- metadata +11 -13
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Check it out if you are looking for other fancy Sinatra extensions.
|
|
15
15
|
Installation
|
16
16
|
------------
|
17
17
|
|
18
|
-
gem install sinatra-sugar
|
18
|
+
gem install sinatra-sugar
|
19
19
|
|
20
20
|
More advanced set
|
21
21
|
-----------------
|
@@ -41,9 +41,28 @@ Ability to extend command line options
|
|
41
41
|
|
42
42
|
Example:
|
43
43
|
|
44
|
-
require "sinatra"
|
44
|
+
require "sinatra/base"
|
45
45
|
require "sinatra/sugar"
|
46
|
-
|
47
|
-
|
46
|
+
|
47
|
+
class App < Sinatra::Base
|
48
|
+
register Sinatra::Sugar
|
48
49
|
run_option_parser.on("-i") { puts "yes, -i is a nice option" }
|
50
|
+
run! if $0 == __FILE__
|
51
|
+
end
|
52
|
+
|
53
|
+
Exposes caller usage of Sinatra
|
54
|
+
-------------------------------
|
55
|
+
|
56
|
+
This is for extension developers only.
|
57
|
+
If you modify some core methods, you don't want your ruby file to be mistaken for the app\_file.
|
58
|
+
You can fix it this way:
|
59
|
+
|
60
|
+
require "sinatra/base"
|
61
|
+
require "sinatra/sugar"
|
62
|
+
module Sinatra
|
63
|
+
Base.ignore_caller
|
64
|
+
module HardcoreExtension
|
65
|
+
# ...
|
66
|
+
end
|
67
|
+
register HardcoreExtension
|
49
68
|
end
|
data/lib/sinatra/sugar.rb
CHANGED
@@ -128,7 +128,7 @@ module Sinatra
|
|
128
128
|
|
129
129
|
# Extended #run!, offers an extandable option parser for
|
130
130
|
# BigBand with the same standard options as the one of
|
131
|
-
# Sinatra
|
131
|
+
# Sinatra::Base (see #run_option_parser).
|
132
132
|
def run!(options = {})
|
133
133
|
run_option_parser.parse!(ARGV.dup) unless ARGV.empty?
|
134
134
|
@running = true
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-sugar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
8
|
- 0
|
9
|
-
|
10
|
-
version: 0.4.0.b
|
9
|
+
version: 0.4.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Konstantin Haase
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-04-13 00:00:00 +02:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -29,8 +28,8 @@ dependencies:
|
|
29
28
|
- 0
|
30
29
|
- 4
|
31
30
|
- 0
|
32
|
-
-
|
33
|
-
version: 0.4.0.
|
31
|
+
- 0
|
32
|
+
version: 0.4.0.0
|
34
33
|
type: :runtime
|
35
34
|
version_requirements: *id001
|
36
35
|
- !ruby/object:Gem::Dependency
|
@@ -44,8 +43,8 @@ dependencies:
|
|
44
43
|
- 0
|
45
44
|
- 4
|
46
45
|
- 0
|
47
|
-
-
|
48
|
-
version: 0.4.0.
|
46
|
+
- 0
|
47
|
+
version: 0.4.0.0
|
49
48
|
type: :development
|
50
49
|
version_requirements: *id002
|
51
50
|
- !ruby/object:Gem::Dependency
|
@@ -85,6 +84,7 @@ extensions: []
|
|
85
84
|
extra_rdoc_files: []
|
86
85
|
|
87
86
|
files:
|
87
|
+
- lib/sinatra/sugar/outstanding_patches.rb
|
88
88
|
- lib/sinatra/sugar.rb
|
89
89
|
- spec/sinatra/sugar_spec.rb
|
90
90
|
- spec/spec_helper.rb
|
@@ -107,13 +107,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: "0"
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- - "
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
segments:
|
113
|
-
-
|
114
|
-
|
115
|
-
- 1
|
116
|
-
version: 1.3.1
|
113
|
+
- 0
|
114
|
+
version: "0"
|
117
115
|
requirements: []
|
118
116
|
|
119
117
|
rubyforge_project:
|