big_band 0.2.1
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.
- data/LICENSE +27 -0
- data/README.rdoc +303 -0
- data/README.rdoc.erb +39 -0
- data/Rakefile +129 -0
- data/big_band.gemspec +29 -0
- data/example/example.rb +13 -0
- data/example/views/index.haml +8 -0
- data/example/views/layout.haml +2 -0
- data/example/views/stylesheets/_base.sass +1 -0
- data/example/views/stylesheets/screen.sass +12 -0
- data/lib/big_band/advanced_routes.rb +184 -0
- data/lib/big_band/basic_extensions.rb +176 -0
- data/lib/big_band/compass/big_band.rb +4 -0
- data/lib/big_band/compass/stylesheets/_big_band.sass +1 -0
- data/lib/big_band/compass/stylesheets/big_band/_blueprint.sass +1 -0
- data/lib/big_band/compass/stylesheets/big_band/_utilities.sass +6 -0
- data/lib/big_band/compass/stylesheets/big_band/blueprint/_html5.sass +4 -0
- data/lib/big_band/compass/stylesheets/big_band/layouts/_inspector.sass +103 -0
- data/lib/big_band/compass/stylesheets/big_band/utilities/_border_radius.sass +27 -0
- data/lib/big_band/compass/stylesheets/big_band/utilities/_css3_prefix.sass +14 -0
- data/lib/big_band/compass/stylesheets/big_band/utilities/_fancy_buttons.sass +62 -0
- data/lib/big_band/compass/stylesheets/big_band/utilities/_html5.sass +3 -0
- data/lib/big_band/compass.rb +94 -0
- data/lib/big_band/files/overlay-button.png +0 -0
- data/lib/big_band/integration/bacon.rb +10 -0
- data/lib/big_band/integration/monk.rb +26 -0
- data/lib/big_band/integration/rake.rb +60 -0
- data/lib/big_band/integration/rspec.rb +11 -0
- data/lib/big_band/integration/test/spec.rb +2 -0
- data/lib/big_band/integration/test/unit.rb +2 -0
- data/lib/big_band/integration/test.rb +42 -0
- data/lib/big_band/integration/test_spec.rb +8 -0
- data/lib/big_band/integration/test_unit.rb +10 -0
- data/lib/big_band/integration/yard.rb +104 -0
- data/lib/big_band/integration.rb +42 -0
- data/lib/big_band/more_helpers.rb +50 -0
- data/lib/big_band/more_server/rainbows.rb +13 -0
- data/lib/big_band/more_server/unicorn.rb +28 -0
- data/lib/big_band/more_server.rb +14 -0
- data/lib/big_band/reloader.rb +113 -0
- data/lib/big_band/sass.rb +28 -0
- data/lib/big_band/version.rb +3 -0
- data/lib/big_band/web_inspector.rb +178 -0
- data/lib/big_band.rb +239 -0
- data/lib/big_bang.rb +6 -0
- data/lib/yard-sinatra.rb +2 -0
- data/spec/big_band/advanced_routes_spec.rb +70 -0
- data/spec/big_band/basic_extensions_spec.rb +39 -0
- data/spec/big_band/more_server_spec.rb +7 -0
- data/spec/big_band/sass_spec.rb +21 -0
- data/spec/spec.opts +5 -0
- data/spec/spec_helper.rb +4 -0
- data/yard-sinatra.gemspec +24 -0
- metadata +167 -0
data/LICENSE
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
copyright (c) 2009 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.rdoc
ADDED
@@ -0,0 +1,303 @@
|
|
1
|
+
= BigBand 0.2.1
|
2
|
+
BigBand is a collection of Sinatra extensions and offers better sinatra integration for common tools.
|
3
|
+
It is pluggable and each extension can be used in stand alone mode.
|
4
|
+
|
5
|
+
The main features are:
|
6
|
+
* Routes as first class objects
|
7
|
+
* Better handling of #set: Merges hashes, more hooks
|
8
|
+
* Better compass integration
|
9
|
+
* Rails-like helpers, like content_for
|
10
|
+
* Unicorn and Rainbows integration
|
11
|
+
* Smart code reloader only reloading changed files and getting rid of old routes
|
12
|
+
* Sass extensions
|
13
|
+
* Routes for inspection in development mode
|
14
|
+
* Helpers and configuration for Bacon, RSpec, Test::Spec and Test::Unit
|
15
|
+
* Tasks listing all routes for Monk and Rake.
|
16
|
+
* YARD: Add Sinatra routes to generated documentation
|
17
|
+
|
18
|
+
Planned features:
|
19
|
+
* More template helpers
|
20
|
+
* ORM integration
|
21
|
+
* Configuration handling
|
22
|
+
* MSpec integration
|
23
|
+
|
24
|
+
== Usage
|
25
|
+
|
26
|
+
Using all BigBand features:
|
27
|
+
|
28
|
+
require "big_band"
|
29
|
+
class Example < BigBand
|
30
|
+
# Yay, BigBand!
|
31
|
+
end
|
32
|
+
|
33
|
+
Or for the lazy folks (read: you would don't subclass Sinatra::Base on your own):
|
34
|
+
|
35
|
+
require "sinatra"
|
36
|
+
require "big_band"
|
37
|
+
# Yay, BigBand!
|
38
|
+
|
39
|
+
Using just your favorite BigBand features:
|
40
|
+
|
41
|
+
require "big_band"
|
42
|
+
class Example < Sinatra::Base
|
43
|
+
register BigBand::SomeFeature
|
44
|
+
# Yay, BigBand::SomeFeature!
|
45
|
+
end
|
46
|
+
|
47
|
+
Or, if you like a more handy syntax:
|
48
|
+
|
49
|
+
require "big_band"
|
50
|
+
class Example < BigBand :SomeFeature, MyStuff::Extension, :development => :DevelopmentOnlyFeature
|
51
|
+
# Yay, BigBand::SomeFeature!
|
52
|
+
# Yay, MyStuff::Extension!
|
53
|
+
# Yay, BigBand::DevelopmentOnlyFeature, if this is development mode!
|
54
|
+
end
|
55
|
+
|
56
|
+
Loading all but one feature:
|
57
|
+
|
58
|
+
require "big_band"
|
59
|
+
class Example < BigBand :except => :SomeFeature
|
60
|
+
# Yay, all but BigBand::SomeFeature!
|
61
|
+
end
|
62
|
+
|
63
|
+
Or just your favorite feature without you subclassing Sinatra::Base manually:
|
64
|
+
|
65
|
+
require "sinatra"
|
66
|
+
require "big_band/some_feature"
|
67
|
+
Sinatra::Application.register BigBand::SomeFeature
|
68
|
+
# Yay, BigBand::SomeFeature!
|
69
|
+
|
70
|
+
== Extensions
|
71
|
+
|
72
|
+
=== AdvancedRoutes
|
73
|
+
|
74
|
+
AdvancedRoutes makes routes first class objects in Sinatra:
|
75
|
+
|
76
|
+
require "sinatra"
|
77
|
+
require "big_band"
|
78
|
+
|
79
|
+
admin_route = get "/admin" do
|
80
|
+
administrate_stuff
|
81
|
+
end
|
82
|
+
|
83
|
+
before do
|
84
|
+
# Let's deactivate the route if we have no password file.
|
85
|
+
if File.exists? "admin_password"
|
86
|
+
admin_route.activate
|
87
|
+
else
|
88
|
+
admin_route.deactivate
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
first_route = get "/:name" do
|
93
|
+
# stuff
|
94
|
+
end
|
95
|
+
|
96
|
+
other_route = get "/foo_:name" do
|
97
|
+
# other stuff
|
98
|
+
end
|
99
|
+
|
100
|
+
# Unfortunatly first_route will catch all the requests other_route would
|
101
|
+
# have gotten, since it has been defined first. But wait, we can fix this!
|
102
|
+
other_route.promote
|
103
|
+
|
104
|
+
=== BasicExtensions
|
105
|
+
|
106
|
+
Basic Sinatra extension (mainly extending Sinatra's standard methods, like set or register).
|
107
|
+
Also it features a more advanced path guessing than Sinatra::Base.
|
108
|
+
Normally you do not have to register this module manually, as the other extensions will do so
|
109
|
+
if necessary.
|
110
|
+
|
111
|
+
=== Compass
|
112
|
+
|
113
|
+
Integrates the Compass stylesheet framework with Sinatra.
|
114
|
+
|
115
|
+
Usage without doing something:
|
116
|
+
|
117
|
+
require "big_band"
|
118
|
+
class Foo < BigBand; end
|
119
|
+
|
120
|
+
If you create a directory called views/stylesheets and place your
|
121
|
+
sass files in there, there you go. Just call stylesheet(name) form
|
122
|
+
your view to get the correct stylesheet tag. The URL for your
|
123
|
+
stylesheets will be /stylesheets/:name.css.
|
124
|
+
|
125
|
+
Of course you can use any other setup. Say, you want to store your
|
126
|
+
stylesheets in views/css and want the URL to be /css/:name.css:
|
127
|
+
|
128
|
+
class Foo < BigBand
|
129
|
+
get_compass("css")
|
130
|
+
end
|
131
|
+
|
132
|
+
But what about more complex setups?
|
133
|
+
|
134
|
+
class Foo < BigBand
|
135
|
+
set :compass, :sass_dir => "/foo/bar/blah"
|
136
|
+
get_compass("/foo/:name.css") do
|
137
|
+
compass :one_stylesheet
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
Note that already generated routes will be deactivated by calling
|
142
|
+
get_compass again.
|
143
|
+
|
144
|
+
=== MoreHelpers
|
145
|
+
|
146
|
+
Adds more helper methods (more docs coming soon).
|
147
|
+
|
148
|
+
=== MoreServer
|
149
|
+
|
150
|
+
Adds more servers to Sinatra::Base#run! (currently unicorn and rainbows).
|
151
|
+
|
152
|
+
=== Reloader
|
153
|
+
|
154
|
+
Advanced reloader for sinatra. Reloads only files that have changed and automatically
|
155
|
+
detects orphaned routes that have to be removed. Files defining routes will be added
|
156
|
+
to the reload list per default. Avoid reloading with dont_reload. Add other files to
|
157
|
+
the reload list with also_reload.
|
158
|
+
|
159
|
+
Usage:
|
160
|
+
|
161
|
+
require "big_band"
|
162
|
+
class Foo < Sinatra::Base
|
163
|
+
configure(:development) do
|
164
|
+
register BigBand::Reloader
|
165
|
+
also_reload "app/models/*.rb"
|
166
|
+
dont_reload "lib/**/*.rb"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
Per default this will only be acitvated in development mode.
|
171
|
+
|
172
|
+
=== Sass
|
173
|
+
|
174
|
+
BigBand::Sass extends SassScript with more functions like min or max.
|
175
|
+
|
176
|
+
Example:
|
177
|
+
.someClass
|
178
|
+
width = max(!default_width - 10px, 200px)
|
179
|
+
|
180
|
+
This can be used without BigBand or even Sinatra.
|
181
|
+
|
182
|
+
=== WebInspector
|
183
|
+
|
184
|
+
The WebInspector allowes you to inspect a running Sinatra app.
|
185
|
+
Just browse http://localhost:4567/\_\_inspect\_\_
|
186
|
+
|
187
|
+
Per default this will only be activated in development mode.
|
188
|
+
|
189
|
+
|
190
|
+
== Tool Integration
|
191
|
+
|
192
|
+
=== Bacon
|
193
|
+
|
194
|
+
Some Bacon example and description goes here.
|
195
|
+
|
196
|
+
=== Monk
|
197
|
+
|
198
|
+
In your Thorfile, place:
|
199
|
+
|
200
|
+
require "big_band/integration/monk"
|
201
|
+
class Monk < Thor
|
202
|
+
routes_task :list_routes
|
203
|
+
end
|
204
|
+
|
205
|
+
Now, running 'monk list_routes' in you project directory should
|
206
|
+
give you a list of all your routes.
|
207
|
+
|
208
|
+
=== Rake
|
209
|
+
|
210
|
+
In your Rakefile, do the following:
|
211
|
+
|
212
|
+
require "big_band/integration/rake"
|
213
|
+
include BigBand::Integration::Rake
|
214
|
+
|
215
|
+
RoutesTask.new
|
216
|
+
|
217
|
+
then you can run 'rake routes' from your
|
218
|
+
project directory and it will list all routes
|
219
|
+
of your app. Per default it will scan for routes
|
220
|
+
defined in ruby files in the directories lib, app,
|
221
|
+
routes, models, views, and controllers (ignoring
|
222
|
+
non-existant directories, of course). You can change
|
223
|
+
that behavior by setting +source+ to another pattern:
|
224
|
+
|
225
|
+
RoutesTask.new { |t| t.source = "**/*.rb" }
|
226
|
+
|
227
|
+
However, you may also just pass in a Sinatra app, so it
|
228
|
+
will not have to scan through the source files:
|
229
|
+
|
230
|
+
require "my_app"
|
231
|
+
RoutesTask.new { |t| t.source = MyApp }
|
232
|
+
|
233
|
+
Keep in mind that a broken my_app in this case would also make
|
234
|
+
your Rakefile unusable.
|
235
|
+
|
236
|
+
Also, you may set another name for the task either by setting
|
237
|
+
the first argument or calling #name=:
|
238
|
+
|
239
|
+
RoutesTask.new(:some_routes) { |t| t.source = SomeApp }
|
240
|
+
RoutesTask.new do |t|
|
241
|
+
t.source = AnotherApp
|
242
|
+
t.name = :other_routes
|
243
|
+
end
|
244
|
+
|
245
|
+
=== RSpec
|
246
|
+
|
247
|
+
Some RSpec example and description goes here.
|
248
|
+
|
249
|
+
=== Test::Spec
|
250
|
+
|
251
|
+
Some TestSpec example and description goes here.
|
252
|
+
|
253
|
+
=== Test::Unit
|
254
|
+
|
255
|
+
Some TestUnit example and description goes here.
|
256
|
+
|
257
|
+
=== YARD
|
258
|
+
|
259
|
+
Some YARD example and description goes here.
|
260
|
+
|
261
|
+
== Running specs
|
262
|
+
|
263
|
+
rake spec
|
264
|
+
|
265
|
+
== Generating documentation
|
266
|
+
|
267
|
+
rake doc
|
268
|
+
|
269
|
+
== Known Issues
|
270
|
+
* Reloader: Needs some more love, but it should not cause any harm.
|
271
|
+
* YARD integration: Routes don't show up in list of all methods. Would prefer a routes list, anyway. Some YARD digging ahead.
|
272
|
+
|
273
|
+
== LICENSE
|
274
|
+
(MIT/BSD-style license, compatible with Ruby license and GPL)
|
275
|
+
|
276
|
+
copyright (c) 2009 Konstantin Haase. All rights reserved.
|
277
|
+
|
278
|
+
Developed by: Konstantin Haase
|
279
|
+
http://github.com/rkh/big_band
|
280
|
+
|
281
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
282
|
+
of this software and associated documentation files (the "Software"), to
|
283
|
+
deal with the Software without restriction, including without limitation the
|
284
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
285
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
286
|
+
furnished to do so, subject to the following conditions:
|
287
|
+
1. Redistributions of source code must retain the above copyright notice,
|
288
|
+
this list of conditions and the following disclaimers.
|
289
|
+
2. Redistributions in binary form must reproduce the above copyright
|
290
|
+
notice, this list of conditions and the following disclaimers in the
|
291
|
+
documentation and/or other materials provided with the distribution.
|
292
|
+
3. Neither the name of Konstantin Haase, nor the names of other contributors
|
293
|
+
may be used to endorse or promote products derived from this Software without
|
294
|
+
specific prior written permission.
|
295
|
+
|
296
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
297
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
298
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
299
|
+
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
300
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
301
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
302
|
+
WITH THE SOFTWARE.
|
303
|
+
|
data/README.rdoc.erb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
= BigBand <%= version %>
|
2
|
+
<%= docstring %>
|
3
|
+
|
4
|
+
|
5
|
+
== Extensions
|
6
|
+
<% extensions.each do |extension| %>
|
7
|
+
|
8
|
+
=== <%= extension.name %>
|
9
|
+
|
10
|
+
<%= extension.docstring %>
|
11
|
+
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
|
15
|
+
== Tool Integration
|
16
|
+
<% integration.each do |tool| %>
|
17
|
+
|
18
|
+
=== <%= tool.name %>
|
19
|
+
|
20
|
+
<%= tool.docstring %>
|
21
|
+
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
== Running specs
|
25
|
+
|
26
|
+
rake spec
|
27
|
+
|
28
|
+
== Generating documentation
|
29
|
+
|
30
|
+
rake doc
|
31
|
+
|
32
|
+
== Known Issues
|
33
|
+
* Reloader: Needs some more love, but it should not cause any harm.
|
34
|
+
* YARD integration: Routes don't show up in list of all methods. Would prefer a routes list, anyway. Some YARD digging ahead.
|
35
|
+
|
36
|
+
== LICENSE
|
37
|
+
(MIT/BSD-style license, compatible with Ruby license and GPL)
|
38
|
+
|
39
|
+
<%= File.read("LICENSE").gsub(/\n/, "\n ") %>
|
data/Rakefile
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
require "erb"
|
2
|
+
require "spec/rake/spectask"
|
3
|
+
require "rake/clean"
|
4
|
+
require "rake/rdoctask"
|
5
|
+
require "monkey-lib"
|
6
|
+
require "yard"
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift __FILE__.dirname.expand_path / "lib"
|
9
|
+
require "big_band/integration/yard"
|
10
|
+
require "big_band/integration/rake"
|
11
|
+
require "big_band/version"
|
12
|
+
|
13
|
+
include BigBand::Integration::Rake
|
14
|
+
RoutesTask.new
|
15
|
+
|
16
|
+
task :default => "gems:build"
|
17
|
+
task :install => "gems:install"
|
18
|
+
task :test => :spec
|
19
|
+
task :clobber => "doc:clobber_rdoc"
|
20
|
+
|
21
|
+
CLEAN.include "**/*.rbc"
|
22
|
+
CLOBBER.include "*.gem", "README.rdoc"
|
23
|
+
|
24
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
25
|
+
t.spec_opts = %w[--options spec/spec.opts]
|
26
|
+
t.spec_files = Dir.glob 'spec/**/*_spec.rb'
|
27
|
+
end
|
28
|
+
|
29
|
+
TOOL_NAMES = { :Rspec => :RSpec, :Yard => :YARD, :TestSpec => :"Test::Spec", :TestUnit => :"Test::Unit" }
|
30
|
+
|
31
|
+
def yard(files)
|
32
|
+
YARD::Registry.load(Dir[files], true)
|
33
|
+
YARD::Registry.resolve(false, "BigBand")
|
34
|
+
end
|
35
|
+
|
36
|
+
def yard_children(ydoc, directory, defaults = {}, &block)
|
37
|
+
children = Dir.glob("#{directory}/*.rb").map { |f| f[(directory.size+1)..-4].to_const_string.to_sym }
|
38
|
+
children.select!(&block) if block
|
39
|
+
children.map! do |name|
|
40
|
+
rewritten_name = defaults[name] || name
|
41
|
+
ydoc.child(rewritten_name) or ydoc.child(name).tap { |c| c.name = rewritten_name unless c.nil? }
|
42
|
+
end
|
43
|
+
children.compact
|
44
|
+
end
|
45
|
+
|
46
|
+
def generate_readme(target = "README.rdoc", template = "README.rdoc.erb")
|
47
|
+
puts "generating #{target} from #{template}"
|
48
|
+
# HACK: loading other libraries later, for some strange heisenbug setting the docstring to an empty string later.
|
49
|
+
docstring = yard("lib/big_band.rb").docstring
|
50
|
+
ydoc = yard("lib/big_band/{**/,}*.rb")
|
51
|
+
extensions = yard_children(ydoc, "lib/big_band") { |n| n != :Integration }
|
52
|
+
integration = yard_children(ydoc.child(:Integration), "lib/big_band/integration", TOOL_NAMES) { |n| n != :Test }
|
53
|
+
version = BigBand::VERSION
|
54
|
+
File.open(target, "w") { |f| f << ERB.new(File.read(template), nil, "<>").result(binding) }
|
55
|
+
end
|
56
|
+
|
57
|
+
file "README.rdoc" => ["README.rdoc.erb", "lib/big_band.rb"] do
|
58
|
+
generate_readme
|
59
|
+
end
|
60
|
+
|
61
|
+
desc "Generate documentation"
|
62
|
+
task "doc" => "doc:yardoc"
|
63
|
+
task "yardoc" => "doc:yardoc"
|
64
|
+
task "rdoc" => "doc:yardoc"
|
65
|
+
|
66
|
+
namespace :doc do
|
67
|
+
|
68
|
+
task "yardoc" => "readme"
|
69
|
+
task "rdoc" => "readme"
|
70
|
+
task "rerdoc" => "readme"
|
71
|
+
|
72
|
+
desc "Generate README.rdoc from source files"
|
73
|
+
task "readme" do |t|
|
74
|
+
generate_readme
|
75
|
+
end
|
76
|
+
|
77
|
+
Rake::RDocTask.new("rdoc") do |rdoc|
|
78
|
+
rdoc.rdoc_dir = 'doc'
|
79
|
+
rdoc.options += %w[-a -S -N -m README.rdoc -q -w 2 -t BigBand -c UTF-8]
|
80
|
+
rdoc.rdoc_files.add ['*.{rdoc,rb}', '{config,lib,routes}/**/*.rb']
|
81
|
+
end
|
82
|
+
|
83
|
+
YARD::Rake::YardocTask.new("yardoc") do |t|
|
84
|
+
t.options = %w[--main README.rdoc --backtrace]
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
task :gems => "gems:build"
|
90
|
+
|
91
|
+
namespace :gems do
|
92
|
+
|
93
|
+
desc "Build gems (runs specs first)"
|
94
|
+
task :build => [:clobber, :spec, "doc:readme"] do
|
95
|
+
GEMS = []
|
96
|
+
Dir.glob("*.gemspec") do |file|
|
97
|
+
sh "gem build #{file}"
|
98
|
+
GEMS << "#{file[0..-9]}-#{BigBand::VERSION}.gem"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
desc "Install gems"
|
103
|
+
task :install => :build do
|
104
|
+
GEMS.each { |file| sh "gem install #{file}" }
|
105
|
+
end
|
106
|
+
|
107
|
+
desc "Publish gems (gemcutter)"
|
108
|
+
task :push => :build do
|
109
|
+
GEMS.each { |file| sh "gem push #{file}" }
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
############
|
115
|
+
# aliases
|
116
|
+
|
117
|
+
task :c => [:clobber, "doc:readme"]
|
118
|
+
task :s => :spec
|
119
|
+
task :d
|
120
|
+
namespace :d do
|
121
|
+
task :r => "doc:readme"
|
122
|
+
task :y => "doc:yardoc"
|
123
|
+
end
|
124
|
+
task :g => :gems
|
125
|
+
namespace :g do
|
126
|
+
task :b => "gems:build"
|
127
|
+
task :i => "gems:install"
|
128
|
+
task :p => "gems:push"
|
129
|
+
end
|
data/big_band.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
$LOAD_PATH.unshift "lib"
|
2
|
+
require "lib/big_band/version"
|
3
|
+
|
4
|
+
SPEC = Gem::Specification.new do |s|
|
5
|
+
|
6
|
+
s.name = "big_band"
|
7
|
+
s.version = BigBand::VERSION
|
8
|
+
s.date = BigBand::DATE
|
9
|
+
s.author = "Konstantin Haase"
|
10
|
+
s.email = "konstantin.mailinglists@googlemail.com"
|
11
|
+
s.homepage = "http://github.com/rkh/big_band"
|
12
|
+
s.platform = Gem::Platform::RUBY
|
13
|
+
s.summary = "Collection of Sinatra extensions and sinatra integration for common tools like Rake, YARD and Monk."
|
14
|
+
s.files = Dir.glob("**/*").reject { |f| File.basename(f)[0] == ?. }
|
15
|
+
s.require_paths = ['lib']
|
16
|
+
s.has_rdoc = true
|
17
|
+
s.description = s.summary + " See README.rdoc for more infos."
|
18
|
+
s.rdoc_options = %w[-a -S -N -m README.rdoc -q -w 2 -t BigBand -c UTF-8]
|
19
|
+
|
20
|
+
s.add_dependency 'sinatra', '>= 0.9.4'
|
21
|
+
s.add_dependency 'monkey-lib', '>= 0.3.2'
|
22
|
+
s.add_dependency 'compass', '>= 0.8.17'
|
23
|
+
s.add_dependency 'yard', '>= 0.5.2'
|
24
|
+
s.add_dependency 'rack-test', '>= 0.5.3'
|
25
|
+
|
26
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
27
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
28
|
+
|
29
|
+
end
|
data/example/example.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
index page
|
2
|
+
%a{:href => "/", :class => "fancy-button1"} fancy
|
3
|
+
%a{:href => "/", :class => "fancy-button2"} fancy
|
4
|
+
%a{:href => "/", :class => "fancy-button3"} fancy
|
5
|
+
%a{:href => "/", :class => "fancy-button4"} fancy
|
6
|
+
%a{:href => "/", :class => "fancy-button5"} fancy
|
7
|
+
%a{:href => "/", :class => "fancy-button6"} fancy
|
8
|
+
%a{:href => "/", :class => "fancy-button7"} fancy
|
@@ -0,0 +1 @@
|
|
1
|
+
@import big_band.sass
|