work-bench 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/work_bench/application.rb +3 -2
- data/lib/work_bench/cli.rb +8 -8
- data/lib/work_bench/version.rb +1 -1
- data/lib/work_bench.rb +0 -1
- data/spec/fixtures/project/export/css/style.css +68 -0
- data/spec/fixtures/project/export/css/test.css +1 -0
- data/spec/fixtures/project/export/data.js1 +1 -0
- data/spec/fixtures/project/export/img/garvcover005.jpg +0 -0
- data/spec/fixtures/project/export/index.html +1 -0
- data/spec/fixtures/project/export/js/jquery.js +9300 -0
- data/spec/fixtures/project/export/js/scripts.js +0 -0
- data/spec/fixtures/project/haml/index.html +1 -1
- data/spec/fixtures/project/public/css/test.css +1 -0
- data/spec/fixtures/project/public/img/garvcover005.jpg +0 -0
- data/spec/fixtures/project/sass/test.sass +2 -0
- data/spec/sass_spec.rb +17 -0
- metadata +47 -26
- data/lib/work_bench/haml_helpers.rb +0 -14
@@ -15,6 +15,7 @@ module Workbench
|
|
15
15
|
use Rack::ShowExceptions
|
16
16
|
use Rack::ContentLength
|
17
17
|
|
18
|
+
# Set config for Compass and SASS
|
18
19
|
Compass.configuration do |config|
|
19
20
|
config.project_path = path
|
20
21
|
config.http_path = '/'
|
@@ -41,8 +42,8 @@ module Workbench
|
|
41
42
|
|
42
43
|
# Start Unicorn server
|
43
44
|
#
|
44
|
-
# @param
|
45
|
-
# @param
|
45
|
+
# @param [Numeric] port port number
|
46
|
+
# @param [Number] workers workers count
|
46
47
|
def start port, workers
|
47
48
|
Unicorn::HttpServer.new(@app, {
|
48
49
|
:listeners => [port],
|
data/lib/work_bench/cli.rb
CHANGED
@@ -13,7 +13,7 @@ module Workbench
|
|
13
13
|
|
14
14
|
# Start Unicorn server
|
15
15
|
#
|
16
|
-
# @param [String] path path to
|
16
|
+
# @param [String] path path to project directory
|
17
17
|
#
|
18
18
|
# @example
|
19
19
|
# workbench start
|
@@ -27,7 +27,7 @@ module Workbench
|
|
27
27
|
method_option :workers, :aliases => '-w', :type => :numeric, :default => 4, :desc => 'Workers'
|
28
28
|
def start path = '.'
|
29
29
|
path = File.expand_path path
|
30
|
-
puts 'Starting HTTP server...'
|
30
|
+
puts 'Starting HTTP server...'.color(:green)
|
31
31
|
app = Workbench::Application.new path
|
32
32
|
app.start options[:port], options[:workers]
|
33
33
|
end
|
@@ -42,12 +42,12 @@ module Workbench
|
|
42
42
|
# @example
|
43
43
|
# workbench init project/
|
44
44
|
#
|
45
|
-
desc 'init [PATH] [--js=frameworks]', 'Initialize empty project
|
46
|
-
long_desc 'Initialize empty project
|
45
|
+
desc 'init [PATH] [--js=frameworks]', 'Initialize empty project'
|
46
|
+
long_desc 'Initialize empty project'
|
47
47
|
method_option :js, :type => :array, :default => ['jquery'], :desc => 'Install specific JS frameworks', :banner => 'jquery jquery-ui json'
|
48
48
|
method_option :normalize, :type => :boolean, :default => true, :desc => 'Add _normalize.css (https://github.com/jonathantneal/normalize.css)'
|
49
49
|
def init path = '.'
|
50
|
-
puts 'Create empty project'
|
50
|
+
puts 'Create empty project'.color(:green)
|
51
51
|
|
52
52
|
self.destination_root = File.expand_path path
|
53
53
|
|
@@ -81,10 +81,10 @@ module Workbench
|
|
81
81
|
# Export project to specific directory
|
82
82
|
#
|
83
83
|
# @param [String] path export directory
|
84
|
-
desc 'export [PATH]', 'Export project'
|
85
|
-
method_option :
|
84
|
+
desc 'export [PATH] [--fix-urls]', 'Export project'
|
85
|
+
method_option :fix_urls, :type => :boolean, :default => true, :desc => 'Fix relative server urls'
|
86
86
|
def export path = 'export'
|
87
|
-
export = Workbench::Exporter.new File.expand_path('.'), File.join(File.expand_path('.'), path), options[:
|
87
|
+
export = Workbench::Exporter.new File.expand_path('.'), File.join(File.expand_path('.'), path), options[:fix_urls]
|
88
88
|
export.process
|
89
89
|
end
|
90
90
|
|
data/lib/work_bench/version.rb
CHANGED
data/lib/work_bench.rb
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
/* normalize.css 2011-07-06T20:20 UTC //github.com/jonathantneal/normalize.css */
|
2
|
+
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
|
3
|
+
|
4
|
+
html { cursor: default; font-size: 100%; overflow-y: scroll; -webkit-tap-highlight-color: transparent; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
|
5
|
+
|
6
|
+
body, form, input, button, select, textarea { font-size: 100%; margin: 0; }
|
7
|
+
|
8
|
+
a, a:active, a:hover { outline: none; }
|
9
|
+
|
10
|
+
a:focus { outline: thin dotted; }
|
11
|
+
|
12
|
+
abbr { _border-bottom: expression(this.title ? '1px dotted':'none'); }
|
13
|
+
|
14
|
+
abbr[title] { border-bottom: 1px dotted; }
|
15
|
+
|
16
|
+
b, strong { font-weight: bold; }
|
17
|
+
|
18
|
+
dfn { font-style: italic; }
|
19
|
+
|
20
|
+
mark { background: #FF0; color: #000; }
|
21
|
+
|
22
|
+
pre, code, kbd, samp { font-family: monospace,monospace; _font-family: 'courier new',monospace; font-size: 1em; }
|
23
|
+
|
24
|
+
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
|
25
|
+
|
26
|
+
q { quotes: none; }
|
27
|
+
|
28
|
+
q:before, q:after { content: ''; content: none; }
|
29
|
+
|
30
|
+
small, sub, sup { font-size: 75%; }
|
31
|
+
|
32
|
+
sub, sup { line-height: 0; position: relative; vertical-align: baseline; }
|
33
|
+
|
34
|
+
sup { top: -0.5em; }
|
35
|
+
|
36
|
+
sub { bottom: -0.25em; }
|
37
|
+
|
38
|
+
nav ul { list-style: none; }
|
39
|
+
|
40
|
+
audio[controls], canvas, video { display: inline-block; *display: inline; }
|
41
|
+
|
42
|
+
audio { display: none; _display: expression(this.controls ? 'inline':'none'); *zoom: 1; }
|
43
|
+
|
44
|
+
audio[controls] { display: inline-block; }
|
45
|
+
|
46
|
+
img { border: 0; -ms-interpolation-mode: bicubic; }
|
47
|
+
|
48
|
+
svg:not(:root) { overflow: hidden; }
|
49
|
+
|
50
|
+
legend { *margin-left: -7px; }
|
51
|
+
|
52
|
+
button, input, select, textarea { -webkit-appearance: none; border-radius: 0; vertical-align: baseline; *vertical-align: middle; }
|
53
|
+
|
54
|
+
button, input { line-height: normal; _overflow: expression(this.type == 'button|reset|submit' ? 'visible':''); }
|
55
|
+
|
56
|
+
button, input[type="button"], input[type="reset"], input[type="submit"] { overflow: visible; }
|
57
|
+
|
58
|
+
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; }
|
59
|
+
|
60
|
+
input[type="search"] { -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
|
61
|
+
|
62
|
+
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
|
63
|
+
|
64
|
+
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
|
65
|
+
|
66
|
+
textarea { overflow: auto; vertical-align: top; }
|
67
|
+
|
68
|
+
table { border-collapse: collapse; border-spacing: 0; }
|
@@ -0,0 +1 @@
|
|
1
|
+
body { color: red; }
|
@@ -0,0 +1 @@
|
|
1
|
+
{}
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<img src="img/garvcover005.jpg">
|