Skip to content

Commit d078290

Browse files
committed
Generate static CSS files after deploy.
1 parent 99dc93e commit d078290

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4488
-2
lines changed

Thorfile

+15-2
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,25 @@ class Monk < Thor
4444
end
4545
end
4646

47-
def init
48-
require "init"
47+
desc "sass", "Compile all Sass files into CSS"
48+
def sass
49+
init
50+
51+
require "sass/plugin"
52+
53+
Sass::Plugin.options.merge! \
54+
:template_location => root_path("app", "views", "css"),
55+
:css_location => File.join(Main.public, "css"),
56+
:cache => false
57+
58+
Sass::Plugin.update_stylesheets
4959
end
5060

5161
private
5262

63+
def init
64+
require "init"
65+
end
5366

5467
def self.source_root
5568
File.dirname(__FILE__)

config/deploy.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# after "deploy:update_code", "deploy:set_permissions"
22
after "deploy:update_code", "deploy:symlink_configs"
3+
after "deploy:update_code", "deploy:sass"
34

45
namespace :deploy do
56
desc "Start the app"
@@ -29,4 +30,9 @@
2930
run "ln -nfs #{shared_path}/config/#{filename}.yml #{release_path}/config/#{filename}.yml"
3031
end
3132
end
33+
34+
desc "Generate static CSS"
35+
task :sass, :roles => :app do
36+
run "cd #{release_path}; ./vendor/thor/bin/thor monk:sass"
37+
end
3238
end

dependencies

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ sinatra 0.9.4 git://github.com/sinatra/sinatra.git
1212
spawn 0.1.2 git://github.com/soveran/spawn.git
1313
stories 0.1.1 git://github.com/citrusbyte/stories.git
1414
sr-webrat 0.4.4.1 (test) git://github.com/djanowski/webrat.git
15+
thor (development) git://github.com/wycats/thor.git

vendor/thor/.autotest

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Autotest.add_hook :initialize do |at|
2+
at.clear_mappings
3+
at.add_exception(/\.git/)
4+
at.add_exception(/spec\/sandbox/)
5+
at.add_mapping(%r{^spec/.*_spec}) {|filename,_| at.files_matching %r{#{filename}}}
6+
at.add_mapping(%r{^bin/thor}) {|_,_| at.files_matching %r{spec/thor_runner_spec}}
7+
at.add_mapping(%r{}) {|_,_| at.files_matching %r{spec/.*_spec}}
8+
end

vendor/thor/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/pkg
2+
/coverage
3+
/spec/sandbox

vendor/thor/CHANGELOG.rdoc

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
== TODO
2+
3+
* Improve spec coverage for Thor::Runner
4+
* Improve help output to list shorthand switches, too
5+
6+
== Current
7+
8+
* BACKWARDS INCOMPATIBLE: aliases are not generated automatically anymore
9+
since it wrong behavior to the invocation system.
10+
11+
* thor help now show information about any class/task. All those calls are
12+
possible:
13+
14+
thor help describe
15+
thor help describe:amazing
16+
17+
Or even with default namespaces:
18+
19+
thor help :spec
20+
21+
* Thor::Runner now invokes the default task if none is supplied:
22+
23+
thor describe # invokes the default task, usually help
24+
25+
* Thor::Runner now works with mappings:
26+
27+
thor describe -h
28+
29+
* Added some documentation and code refactoring.
30+
31+
== 0.9.8, released 2008-10-20
32+
33+
* Fixed some tiny issues that were introduced lately.
34+
35+
== 0.9.7, released 2008-10-13
36+
37+
* Setting global method options on the initialize method works as expected:
38+
All other tasks will accept these global options in addition to their own.
39+
* Added 'group' notion to Thor task sets (class Thor); by default all tasks
40+
are in the 'standard' group. Running 'thor -T' will only show the standard
41+
tasks - adding --all will show all tasks. You can also filter on a specific
42+
group using the --group option: thor -T --group advanced
43+
44+
== 0.9.6, released 2008-09-13
45+
46+
* Generic improvements
47+
48+
== 0.9.5, released 2008-08-27
49+
50+
* Improve Windows compatibility
51+
* Update (incorrect) README and task.thor sample file
52+
* Options hash is now frozen (once returned)
53+
* Allow magic predicates on options object. For instance: `options.force?`
54+
* Add support for :numeric type
55+
* BACKWARDS INCOMPATIBLE: Refactor Thor::Options. You cannot access shorthand forms in options hash anymore (for instance, options[:f])
56+
* Allow specifying optional args with default values: method_options(:user => "mislav")
57+
* Don't write options for nil or false values. This allows, for example, turning color off when running specs.
58+
* Exit with the status of the spec command to help CI stuff out some.
59+
60+
== 0.9.4, released 2008-08-13
61+
62+
* Try to add Windows compatibility.
63+
* BACKWARDS INCOMPATIBLE: options hash is now accessed as a property in your class and is not passed as last argument anymore
64+
* Allow options at the beginning of the argument list as well as the end.
65+
* Make options available with symbol keys in addition to string keys.
66+
* Allow true to be passed to Thor#method_options to denote a boolean option.
67+
* If loading a thor file fails, don't give up, just print a warning and keep going.
68+
* Make sure that we re-raise errors if they happened further down the pipe than we care about.
69+
* Only delete the old file on updating when the installation of the new one is a success
70+
* Make it Ruby 1.8.5 compatible.
71+
* Don't raise an error if a boolean switch is defined multiple times.
72+
* Thor::Options now doesn't parse through things that look like options but aren't.
73+
* Add URI detection to install task, and make sure we don't append ".thor" to URIs
74+
* Add rake2thor to the gem binfiles.
75+
* Make sure local Thorfiles override system-wide ones.

vendor/thor/LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2008 Yehuda Katz
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)