capucine 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -0
- data/bin/capucine +1 -2
- data/content/shared/images/favicon/apple-touch-icon-114x114-precomposed.png +0 -0
- data/content/shared/images/favicon/apple-touch-icon-57x57-precomposed.png +0 -0
- data/content/shared/images/favicon/apple-touch-icon-72x72-precomposed.png +0 -0
- data/content/shared/images/favicon/apple-touch-icon-precomposed.png +0 -0
- data/content/shared/images/favicon/favicon.png +0 -0
- data/content/shared/sass/screen.sass +16 -0
- data/content/shared/templates/_footer.html +2 -1
- data/content/shared/templates/_header.html +2 -3
- data/content/templates/capucine.yaml +16 -23
- data/content/templates/cmd_help.erb +44 -0
- data/content/templates/compass_config.erb +6 -8
- data/lib/coffeescript.rb +55 -36
- data/lib/commands.rb +10 -12
- data/lib/compass-sass.rb +26 -24
- data/lib/incloudr.rb +0 -7
- data/lib/settings.rb +20 -5
- data/lib/tools.rb +4 -13
- data/lib/watch.rb +25 -20
- metadata +24 -24
- data/content/shared/sass/_print.sass +0 -46
- data/content/shared/sass/all.scss +0 -12
- data/content/templates/cmd_help.txt +0 -28
- /data/content/shared/coffeescript/{app.js.coffee → app.coffee} +0 -0
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.4
|
data/bin/capucine
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@import "compass"
|
2
|
+
|
3
|
+
@import "sass-capucine"
|
4
|
+
|
5
|
+
// OR :
|
6
|
+
// @import "sass-capucine/reset"
|
7
|
+
// @import "sass-capucine/print"
|
8
|
+
// @import "sass-capucine/box"
|
9
|
+
// @import "sass-capucine/shortcuts"
|
10
|
+
// @import "sass-capucine/helpers"
|
11
|
+
|
12
|
+
// YOUR FILES :
|
13
|
+
@import "shared"
|
14
|
+
@import "home"
|
15
|
+
@import "responsive"
|
16
|
+
@import "ie"
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
</div>
|
3
|
-
<script src="
|
3
|
+
<script src="js/libs/jquery.min.js"></script>
|
4
|
+
<script src="js_generated/app.min.js"></script>
|
4
5
|
<!--[if lt IE 7 ]>
|
5
6
|
<script defer src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
|
6
7
|
<script defer>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
7
|
-
<title
|
7
|
+
<title>-</title>
|
8
8
|
|
9
9
|
<meta name="description" content="">
|
10
10
|
<meta name="author" content="">
|
@@ -23,8 +23,7 @@
|
|
23
23
|
<!-- <link rel="apple-touch-icon" href="images/favicon/apple-touch-icon-57x57-precomposed.png" sizes="57x57"> -->
|
24
24
|
<!-- <link rel="apple-touch-icon" href="images/favicon/apple-touch-icon-72x72-precomposed.png" sizes="72x72"> -->
|
25
25
|
<!-- <link rel="apple-touch-icon" href="images/favicon/apple-touch-icon-114x114-precomposed.png" sizes="114x114"> -->
|
26
|
-
<link rel="stylesheet" href="css_generated/
|
27
|
-
|
26
|
+
<link rel="stylesheet" href="css_generated/screen.css">
|
28
27
|
</head>
|
29
28
|
<body class="home_view">
|
30
29
|
<div id="page_wrap" class="wrap">
|
@@ -1,35 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
compass_enable: true
|
1
|
+
sass_enable: true
|
4
2
|
coffeescript_enable: true
|
5
3
|
templates_enable: true
|
6
|
-
incloudr_enable: true
|
7
4
|
|
8
5
|
# ----------------------------------------
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
compass_sass_cache: false
|
6
|
+
sass_images_dir: 'images'
|
7
|
+
sass_files_dir: 'sass'
|
8
|
+
sass_output_dir: 'css_generated'
|
9
|
+
sass_line_comments: false
|
10
|
+
sass_css_generated_style: 'compressed' # nested , expanded, compact, compressed
|
11
|
+
sass_options: {:cache: false}
|
16
12
|
compass_plugins:
|
17
13
|
- 'sass-capucine'
|
18
14
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
sass_import_css: false
|
16
|
+
sass_import_formats: 'css to sass'
|
17
|
+
sass_import_css_dir: 'css/import'
|
18
|
+
sass_import_output_dir: 'sass/converted'
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
coffeescript_options: {bare: true}
|
21
|
+
coffeescript_files_dir: 'coffeescript'
|
22
|
+
coffeescript_output_dir: 'js_generated'
|
27
23
|
|
28
24
|
templates_erb_files_dir: 'templates'
|
29
25
|
|
30
|
-
incloudr_output_dir: 'js_generated/pack'
|
31
|
-
incloudr_files:
|
32
|
-
'main.js':
|
33
|
-
- 'js/libs/jquery.min.js'
|
34
|
-
- 'js_generated/app.js'
|
35
26
|
|
27
|
+
# DOCUMENTATION :
|
28
|
+
# http:// capucine.dln.name
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Capucine - <%= config %>
|
2
|
+
Usage:
|
3
|
+
|
4
|
+
Configure your preferences in capucine.yaml
|
5
|
+
|
6
|
+
$ capucine [option]
|
7
|
+
|
8
|
+
Options:
|
9
|
+
|
10
|
+
new [name] - Create a new project
|
11
|
+
If not name specified, this will create the folder : capucine/
|
12
|
+
|
13
|
+
init - Initialize a project in current folder (simply add a capucine.yaml file)
|
14
|
+
|
15
|
+
compile [path/to/config] - Compile .sass, .coffee, .erb files (just once)
|
16
|
+
|
17
|
+
watch [path/to/config] - Compile .sass, .coffee, .erb files (run the watcher).
|
18
|
+
|
19
|
+
help - Print this message
|
20
|
+
|
21
|
+
Shortcuts:
|
22
|
+
|
23
|
+
n = new
|
24
|
+
|
25
|
+
i = init
|
26
|
+
|
27
|
+
c = compile
|
28
|
+
|
29
|
+
w = watch
|
30
|
+
|
31
|
+
h = help
|
32
|
+
|
33
|
+
Informations:
|
34
|
+
|
35
|
+
Github - https://github.com/damln/Capucine
|
36
|
+
Documentation - http://capucine.dln.name
|
37
|
+
Twitter - @wearecapucine ( http://twitter.com/wearecapucine )
|
38
|
+
|
39
|
+
Author:
|
40
|
+
|
41
|
+
Name - Damian Le Nouaillle
|
42
|
+
Site - http://dln.name
|
43
|
+
Twitter - @damln ( http://twitter.com/damln )
|
44
|
+
|
@@ -4,12 +4,10 @@ require "<%= plugin %>"
|
|
4
4
|
<% end %>
|
5
5
|
<% end %>
|
6
6
|
|
7
|
-
images_dir = "<%= config["
|
8
|
-
sass_dir = "<%= config["
|
9
|
-
css_dir = "<%= config["
|
10
|
-
line_comments = <%= config["
|
11
|
-
output_style = :<%= config["
|
12
|
-
|
13
|
-
sass_options = {:cache => false}
|
14
|
-
<% end %>
|
7
|
+
images_dir = "<%= config["sass_images_dir"] %>"
|
8
|
+
sass_dir = "<%= config["sass_files_dir"] %>"
|
9
|
+
css_dir = "<%= config["sass_output_dir"] %>"
|
10
|
+
line_comments = <%= config["sass_line_comments"] %>
|
11
|
+
output_style = :<%= config["sass_css_generated_style"] %>
|
12
|
+
sass_options = <%= config["sass_options"] %>
|
15
13
|
|
data/lib/coffeescript.rb
CHANGED
@@ -1,50 +1,52 @@
|
|
1
1
|
module Capucine
|
2
2
|
class Coffee
|
3
3
|
require 'packr'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
require 'coffee-script'
|
5
|
+
require 'fssm'
|
6
|
+
|
7
|
+
def self.compile_dir input, output
|
8
8
|
settings = Capucine.settings
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
if File.extname(input) == '.coffee'
|
11
|
+
coffee_files = input
|
12
|
+
else
|
13
|
+
coffee_files = File.join settings.working_dir, input, "**/**.coffee"
|
14
|
+
end
|
12
15
|
|
13
16
|
Dir.glob(coffee_files).each do |file_coffee_o|
|
14
17
|
|
15
18
|
file_coffee = File.expand_path file_coffee_o
|
16
|
-
base_in_dir = File.join settings.working_dir,
|
19
|
+
base_in_dir = File.join settings.working_dir, input
|
17
20
|
|
18
21
|
relative_path = File.basename(file_coffee)
|
19
22
|
relative_path = relative_path.gsub(/\.coffee$/, '.js')
|
20
23
|
relative_path_min = relative_path.gsub(/\.js$/, '.min.js')
|
21
24
|
|
22
|
-
file_out = File.join settings.working_dir,
|
23
|
-
file_out_min = File.join settings.working_dir,
|
24
|
-
|
25
|
+
file_out = File.join settings.working_dir, output, relative_path
|
26
|
+
file_out_min = File.join settings.working_dir, output, relative_path_min
|
25
27
|
|
26
28
|
relative_coffee_file = file_coffee.gsub(base_in_dir, '')
|
27
|
-
|
28
|
-
|
29
|
-
bare_opt = true if settings.config['coffeescript_coffee_bare']
|
29
|
+
|
30
|
+
opts = settings.config['coffeescript_options']
|
30
31
|
|
31
32
|
coffee_output_min = ""
|
32
|
-
|
33
|
+
|
34
|
+
error = false
|
33
35
|
begin
|
34
|
-
coffee_output = CoffeeScript.compile(File.read(file_coffee),
|
35
|
-
coffee_output_min << Packr.pack(coffee_output)
|
36
|
-
|
36
|
+
coffee_output = CoffeeScript.compile(File.read(file_coffee), opts)
|
37
37
|
rescue Exception => e
|
38
|
+
error = true
|
39
|
+
message = "#{e.message}"
|
38
40
|
coffee_output = "var message = \"CoffeeScript Error (#{relative_coffee_file.gsub(/^\//, '')}) => \";"
|
39
|
-
coffee_output += "message += \"#{
|
41
|
+
coffee_output += "message += \"#{message}\";"
|
40
42
|
coffee_output += "throw message;"
|
41
|
-
message = "#{e.message}"
|
42
43
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
|
45
|
+
coffee_output_min << Packr.pack(coffee_output)
|
46
46
|
FileUtils.mkdir_p File.dirname(file_out)
|
47
|
-
|
47
|
+
|
48
|
+
puts "[coffee] - #{relative_path} => #{message}" if error
|
49
|
+
|
48
50
|
f1 = File.open(file_out, 'w+')
|
49
51
|
f1.write(coffee_output)
|
50
52
|
f1.close
|
@@ -52,41 +54,58 @@ module Capucine
|
|
52
54
|
f2 = File.open(file_out_min, 'w+')
|
53
55
|
f2.write(coffee_output_min)
|
54
56
|
f2.close
|
55
|
-
|
56
57
|
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.run_once file = nil
|
62
|
+
settings = Capucine.settings
|
57
63
|
|
64
|
+
unless file
|
65
|
+
self.compile_dir settings.config['coffeescript_files_dir'], settings.config['coffeescript_output_dir']
|
66
|
+
else
|
67
|
+
self.compile_dir file, settings.config['coffeescript_output_dir']
|
68
|
+
end
|
69
|
+
|
58
70
|
puts "[coffee] - Compiled"
|
59
|
-
Capucine::Incloudr.run_once if settings.config['incloudr_enable']
|
71
|
+
# Capucine::Incloudr.run_once if settings.config['incloudr_enable']
|
60
72
|
end
|
61
|
-
|
73
|
+
|
62
74
|
def self.proc_watch
|
63
|
-
require 'fssm'
|
64
75
|
settings = Capucine.settings
|
65
76
|
|
77
|
+
files_to_lookat = File.join settings.working_dir, settings.config['coffeescript_files_dir']
|
78
|
+
js_generated_dir = File.join settings.working_dir, settings.config['coffeescript_output_dir']
|
79
|
+
|
66
80
|
coffee_thread = Thread.new {
|
67
|
-
files_to_lookat = File.join settings.working_dir, settings.config['coffeescript_coffee_files_dir']
|
68
|
-
|
69
81
|
FSSM.monitor(files_to_lookat, :directories => true) do
|
70
82
|
update do |b, r|
|
71
|
-
|
83
|
+
file = File.join b, r
|
84
|
+
Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
|
72
85
|
end
|
73
86
|
|
74
87
|
create do |b, r|
|
75
|
-
|
88
|
+
file = File.join b, r
|
89
|
+
Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
|
76
90
|
end
|
77
91
|
|
78
92
|
delete do |b, r|
|
79
|
-
|
80
|
-
|
93
|
+
|
81
94
|
file_name = File.expand_path File.join(b, r)
|
82
95
|
folder_name = File.dirname file_name
|
83
|
-
|
96
|
+
js_files = [
|
97
|
+
File.join(js_generated_dir, r.gsub('.coffee', '.js')),
|
98
|
+
File.join(js_generated_dir, r.gsub('.coffee', '.min.js')),
|
99
|
+
]
|
84
100
|
|
85
101
|
if Dir["#{folder_name}/*"].empty? and folder_name != js_generated_dir
|
86
|
-
|
102
|
+
# delete full dir
|
103
|
+
to_delete = File.expand_path(File.dirname(js_files[0]))
|
87
104
|
FileUtils.rm_r to_delete
|
88
105
|
else
|
89
|
-
|
106
|
+
js_files.each do |file|
|
107
|
+
File.delete(file) if File.exist?(file)
|
108
|
+
end
|
90
109
|
end
|
91
110
|
|
92
111
|
end
|
data/lib/commands.rb
CHANGED
@@ -8,28 +8,26 @@ module Capucine
|
|
8
8
|
second_arg = args[1]
|
9
9
|
cap = Capucine.new
|
10
10
|
|
11
|
-
if first_arg == 'help'
|
12
|
-
|
13
|
-
|
11
|
+
if first_arg == 'help' or first_arg == 'h'
|
12
|
+
Capucine::Commands.help
|
14
13
|
elsif first_arg == 'new' or first_arg == 'n'
|
15
14
|
Capucine::Tools.new_project second_arg
|
16
|
-
|
17
15
|
elsif first_arg == 'init' or first_arg == 'i'
|
18
16
|
Capucine::Tools.init second_arg
|
19
|
-
|
20
17
|
elsif first_arg == 'compile' or first_arg == 'c'
|
21
|
-
Capucine::
|
22
|
-
|
18
|
+
Capucine::Watchr.compile second_arg
|
23
19
|
elsif first_arg == 'watch' or first_arg == 'w'
|
24
|
-
Capucine::Watchr.
|
25
|
-
|
20
|
+
Capucine::Watchr.watch second_arg
|
26
21
|
else
|
27
|
-
|
22
|
+
Capucine::Commands.help
|
28
23
|
end
|
29
24
|
end
|
30
25
|
|
31
|
-
def help
|
32
|
-
|
26
|
+
def self.help
|
27
|
+
file_name = File.join Capucine.settings.gem_content_dir, 'templates', 'cmd_help.erb'
|
28
|
+
version = File.read(File.join(Capucine.settings.gem_dir, 'VERSION'))
|
29
|
+
render = Capucine::Tools.render_template file_name, version
|
30
|
+
puts render
|
33
31
|
exit
|
34
32
|
end
|
35
33
|
|
data/lib/compass-sass.rb
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
module Capucine
|
2
2
|
class CompassSass
|
3
|
-
|
3
|
+
|
4
|
+
def self.update_plugins
|
4
5
|
plugins = Capucine.settings.config['compass_plugins']
|
5
6
|
return if not plugins
|
6
7
|
|
7
8
|
plugins.each do |plugin|
|
8
|
-
require 'rubygems'
|
9
|
-
require 'sass'
|
10
|
-
|
11
9
|
begin
|
12
10
|
require "#{plugin}"
|
13
11
|
rescue LoadError
|
14
|
-
system("gem install #{plugin} --no-ri --no-rdoc")
|
12
|
+
system("gem install #{plugin} --no-ri --no-rdoc")
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -20,17 +18,15 @@ module Capucine
|
|
20
18
|
settings = Capucine.settings
|
21
19
|
template_file = File.join settings.gem_content_dir, 'templates', 'compass_config.erb'
|
22
20
|
output_file = File.join settings.working_dir, '.compass.rb'
|
23
|
-
|
24
21
|
config_ = settings.config
|
25
|
-
|
22
|
+
|
26
23
|
result = Capucine::Tools.render_template template_file, config_
|
27
24
|
|
28
25
|
f = File.open(output_file, 'w')
|
29
26
|
f.write(result)
|
30
27
|
f.close
|
31
28
|
|
32
|
-
|
33
|
-
# self.update_plugins force = true
|
29
|
+
self.update_plugins
|
34
30
|
end
|
35
31
|
|
36
32
|
# def self.load_my_functions
|
@@ -43,14 +39,15 @@ module Capucine
|
|
43
39
|
# end
|
44
40
|
|
45
41
|
def self.import_css
|
42
|
+
|
46
43
|
s = Capucine.settings
|
47
|
-
import_dir = File.join s.working_dir, s.config['
|
48
|
-
output_dir= File.join s.working_dir, s.config['
|
44
|
+
import_dir = File.join s.working_dir, s.config['sass_import_css_dir']
|
45
|
+
output_dir= File.join s.working_dir, s.config['sass_import_output_dir']
|
49
46
|
|
50
47
|
Dir.mkdir(import_dir) if not File.directory?(import_dir)
|
51
48
|
Dir.mkdir(output_dir) if not File.directory?(output_dir)
|
52
49
|
|
53
|
-
formats = s.config['
|
50
|
+
formats = s.config['sass_import_formats'].split
|
54
51
|
from_format = formats[0]
|
55
52
|
to_format = formats[2]
|
56
53
|
|
@@ -63,29 +60,34 @@ module Capucine
|
|
63
60
|
def self.run_once
|
64
61
|
self.update_config
|
65
62
|
# self.load_my_functions
|
66
|
-
self.import_css if Capucine.settings.config['
|
67
|
-
|
63
|
+
self.import_css if Capucine.settings.config['sass_import_css']
|
68
64
|
config = File.join Capucine.settings.working_dir, '.compass.rb'
|
69
|
-
|
70
65
|
command = "compass compile --quiet --config #{config} #{Capucine.settings.working_dir}"
|
71
66
|
system(command)
|
72
|
-
|
73
67
|
puts "[compass] - Compiled"
|
74
68
|
end
|
75
69
|
|
70
|
+
def self.export_path
|
71
|
+
require 'compass'
|
72
|
+
require 'rubygems'
|
73
|
+
path_compass = Gem.loaded_specs['compass'].full_gem_path
|
74
|
+
ENV['PATH'] = "#{path_compass}:#{Capucine.settings.gem_dir}:#{ENV['PATH']}"
|
75
|
+
end
|
76
|
+
|
76
77
|
def self.proc_watch
|
77
78
|
self.update_config
|
78
|
-
|
79
79
|
config_file = File.join Capucine.settings.working_dir, '.compass.rb'
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
compass_proc = Thread.new {
|
84
|
-
system(command)
|
80
|
+
compass_args = ['watch', '--config', config_file, Capucine.settings.working_dir]
|
81
|
+
proc_watch = Thread.new {
|
82
|
+
self.exec_compass compass_args
|
85
83
|
}
|
84
|
+
return proc_watch
|
85
|
+
end
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
def self.exec_compass compass_args
|
88
|
+
require 'compass'
|
89
|
+
require 'compass/exec'
|
90
|
+
Compass::Exec::SubCommandUI.new(compass_args).run!
|
89
91
|
end
|
90
92
|
|
91
93
|
end
|
data/lib/incloudr.rb
CHANGED
@@ -25,7 +25,6 @@ module Capucine
|
|
25
25
|
FileUtils.mkdir_p out if not File.exist?(out)
|
26
26
|
|
27
27
|
content = ""
|
28
|
-
# content_min = ""
|
29
28
|
|
30
29
|
files.each do |js_file|
|
31
30
|
extended = File.join s.working_dir, js_file
|
@@ -36,12 +35,6 @@ module Capucine
|
|
36
35
|
f.write('')
|
37
36
|
f.write(content)
|
38
37
|
f.close
|
39
|
-
|
40
|
-
# f2 = File.open(output_file_min, 'w')
|
41
|
-
# f2.write('')
|
42
|
-
# f2.write(content_min)
|
43
|
-
# f2.close
|
44
|
-
|
45
38
|
end
|
46
39
|
|
47
40
|
# def self.lib_root
|
data/lib/settings.rb
CHANGED
@@ -23,7 +23,6 @@ module Capucine
|
|
23
23
|
def get_config user_config_file = nil
|
24
24
|
default = File.join @gem_content_dir, "templates", "#{Capucine.get_name}.yaml"
|
25
25
|
@config = YAML::load(File.open(default))
|
26
|
-
# Load user config :
|
27
26
|
|
28
27
|
from_user = File.join @working_dir, "#{Capucine.get_name}.yaml"
|
29
28
|
from_user = File.expand_path user_config_file if user_config_file
|
@@ -34,18 +33,34 @@ module Capucine
|
|
34
33
|
additional = YAML::load(File.open(from_user))
|
35
34
|
|
36
35
|
if additional
|
37
|
-
# Overload default.yaml :
|
38
36
|
additional.each do |k, v|
|
39
37
|
@config[k] = nil
|
40
38
|
@config[k] = v
|
41
39
|
end
|
42
40
|
end
|
43
|
-
|
44
|
-
|
41
|
+
#self.test_config
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_config
|
45
|
+
# TO DO :
|
46
|
+
conf_dirs = []
|
47
|
+
dirs = []
|
48
|
+
for conf in conf_dirs
|
49
|
+
conf = @config[conf]
|
50
|
+
dirs.push File.join(@working_dir,conf)
|
51
|
+
end
|
52
|
+
|
53
|
+
for dir in dirs
|
54
|
+
unless File.directory?(dir)
|
55
|
+
puts "[error] #{dir} - Does not exist."
|
56
|
+
exit
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
45
61
|
def reset_working_dir
|
46
62
|
@working_dir = File.expand_path Dir.pwd
|
47
63
|
end
|
48
|
-
|
49
64
|
end
|
50
65
|
end
|
51
66
|
|
data/lib/tools.rb
CHANGED
@@ -40,21 +40,10 @@ module Capucine
|
|
40
40
|
content_files.each {|file| files << file}
|
41
41
|
|
42
42
|
FileUtils.cp_r files, Capucine.settings.working_dir
|
43
|
-
|
44
|
-
|
43
|
+
Capucine::Watchr.compile if all
|
45
44
|
Capucine.settings.reset_working_dir
|
46
45
|
end
|
47
46
|
|
48
|
-
def self.compile
|
49
|
-
Capucine.settings.get_config
|
50
|
-
@config = Capucine.settings.config
|
51
|
-
|
52
|
-
Capucine::CompassSass.run_once if @config['compass_enable']
|
53
|
-
Capucine::Coffee.run_once if @config['coffeescript_enable']
|
54
|
-
Capucine::Templates.run_once if @config['templates_enable']
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
47
|
def self.render_template template_file, content = nil
|
59
48
|
config = content
|
60
49
|
template = ERB.new File.new(template_file).read
|
@@ -89,8 +78,10 @@ module Capucine
|
|
89
78
|
FileUtils.mv path, new_dir_name
|
90
79
|
|
91
80
|
end
|
81
|
+
|
82
|
+
|
92
83
|
|
93
|
-
def clean_name name
|
84
|
+
def self.clean_name name
|
94
85
|
require_relative 'extend_string'
|
95
86
|
name.removeaccents
|
96
87
|
name.urlize({:downcase => true, :convert_spaces => true})
|
data/lib/watch.rb
CHANGED
@@ -4,33 +4,38 @@ module Capucine
|
|
4
4
|
require 'coffeescript.rb'
|
5
5
|
require "templates.rb"
|
6
6
|
|
7
|
-
def
|
8
|
-
|
9
|
-
@config = Capucine.settings.config
|
7
|
+
def self.watch config_file = nil
|
8
|
+
self.compile config_file
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def watch
|
10
|
+
if config_file
|
11
|
+
Capucine.settings.get_config config_file
|
12
|
+
else
|
13
|
+
Capucine.settings.get_config
|
14
|
+
end
|
15
|
+
|
16
|
+
@config = Capucine.settings.config
|
19
17
|
|
20
|
-
|
18
|
+
sass_proc = Capucine::CompassSass.proc_watch if @config['sass_enable']
|
21
19
|
coffeescript_proc = Capucine::Coffee.proc_watch if @config['coffeescript_enable']
|
22
20
|
templates_proc = Capucine::Templates.proc_watch if @config['templates_enable']
|
23
21
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
templates_proc.join if templates_proc
|
29
|
-
}
|
22
|
+
sass_proc.join if sass_proc
|
23
|
+
coffeescript_proc.join if coffeescript_proc
|
24
|
+
templates_proc.join if templates_proc
|
25
|
+
end
|
30
26
|
|
31
|
-
|
27
|
+
def self.compile config_file = nil
|
28
|
+
if config_file
|
29
|
+
Capucine.settings.get_config config_file
|
30
|
+
else
|
31
|
+
Capucine.settings.get_config
|
32
|
+
end
|
32
33
|
|
34
|
+
@config = Capucine.settings.config
|
35
|
+
|
36
|
+
Capucine::CompassSass.run_once if @config['sass_enable']
|
37
|
+
Capucine::Coffee.run_once if @config['coffeescript_enable']
|
38
|
+
Capucine::Templates.run_once if @config['templates_enable']
|
33
39
|
end
|
34
|
-
|
35
40
|
end
|
36
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capucine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fssm
|
16
|
-
requirement: &
|
16
|
+
requirement: &70163827911720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70163827911720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: compass
|
27
|
-
requirement: &
|
27
|
+
requirement: &70163827910880 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70163827910880
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: coffee-script
|
38
|
-
requirement: &
|
38
|
+
requirement: &70163827910060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70163827910060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: uglifier
|
49
|
-
requirement: &
|
49
|
+
requirement: &70163827909160 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70163827909160
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: packr
|
60
|
-
requirement: &
|
60
|
+
requirement: &70163827907860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70163827907860
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: term-ansicolor
|
71
|
-
requirement: &
|
71
|
+
requirement: &70163827905200 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70163827905200
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: zip
|
82
|
-
requirement: &
|
82
|
+
requirement: &70163827904200 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70163827904200
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sass-capucine
|
93
|
-
requirement: &
|
93
|
+
requirement: &70163827903220 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,15 +98,16 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
102
|
-
description:
|
101
|
+
version_requirements: *70163827903220
|
102
|
+
description: Capucine, the missing tool for frontend developers.
|
103
103
|
email: dam@dln.name
|
104
104
|
executables:
|
105
105
|
- capucine
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
|
-
-
|
109
|
+
- VERSION
|
110
|
+
- content/shared/coffeescript/app.coffee
|
110
111
|
- content/shared/css/import/YOUR_OLD_CSS
|
111
112
|
- content/shared/images/favicon/apple-touch-icon-114x114-precomposed.png
|
112
113
|
- content/shared/images/favicon/apple-touch-icon-57x57-precomposed.png
|
@@ -117,15 +118,14 @@ files:
|
|
117
118
|
- content/shared/js/libs/jquery.min.js
|
118
119
|
- content/shared/sass/_home.sass
|
119
120
|
- content/shared/sass/_ie.sass
|
120
|
-
- content/shared/sass/_print.sass
|
121
121
|
- content/shared/sass/_responsive.sass
|
122
122
|
- content/shared/sass/_shared.sass
|
123
|
-
- content/shared/sass/
|
123
|
+
- content/shared/sass/screen.sass
|
124
124
|
- content/shared/templates/_footer.html
|
125
125
|
- content/shared/templates/_header.html
|
126
126
|
- content/shared/templates/index.html.erb
|
127
127
|
- content/templates/capucine.yaml
|
128
|
-
- content/templates/cmd_help.
|
128
|
+
- content/templates/cmd_help.erb
|
129
129
|
- content/templates/compass_config.erb
|
130
130
|
- lib/capucine.rb
|
131
131
|
- lib/coffeescript.rb
|
@@ -137,7 +137,7 @@ files:
|
|
137
137
|
- lib/tools.rb
|
138
138
|
- lib/watch.rb
|
139
139
|
- bin/capucine
|
140
|
-
homepage: http://dln.name
|
140
|
+
homepage: http://capucine.dln.name
|
141
141
|
licenses: []
|
142
142
|
post_install_message:
|
143
143
|
rdoc_options: []
|
@@ -1,46 +0,0 @@
|
|
1
|
-
//---------------------------
|
2
|
-
// PRINT
|
3
|
-
|
4
|
-
=basic_print
|
5
|
-
*
|
6
|
-
background: transparent !important
|
7
|
-
color: black !important
|
8
|
-
text-shadow: none !important
|
9
|
-
filter: none !important
|
10
|
-
-ms-filter: none !important
|
11
|
-
a
|
12
|
-
color: #444 !important
|
13
|
-
text-decoration: underline
|
14
|
-
&:visited
|
15
|
-
color: #444 !important
|
16
|
-
text-decoration: underline
|
17
|
-
&[href]:after
|
18
|
-
content: " (" attr(href) ")"
|
19
|
-
abbr[title]:after
|
20
|
-
content: " (" attr(title) ")"
|
21
|
-
.ir a:after
|
22
|
-
content: ""
|
23
|
-
a
|
24
|
-
&[href^="javascript:"]:after, &[href^="#"]:after
|
25
|
-
content: ""
|
26
|
-
pre, blockquote
|
27
|
-
border: 1px solid #999
|
28
|
-
page-break-inside: avoid
|
29
|
-
thead
|
30
|
-
display: table-header-group
|
31
|
-
tr, img
|
32
|
-
page-break-inside: avoid
|
33
|
-
|
34
|
-
@page
|
35
|
-
margin: 0.5cm
|
36
|
-
|
37
|
-
p, h2, h3
|
38
|
-
orphans: 3
|
39
|
-
widows: 3
|
40
|
-
h2, h3
|
41
|
-
page-break-after: avoid
|
42
|
-
|
43
|
-
@media print
|
44
|
-
|
45
|
-
// +basic_print
|
46
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
|
2
|
-
Usage:
|
3
|
-
|
4
|
-
Configure your preferences in capucine.yaml
|
5
|
-
|
6
|
-
epycea [option]
|
7
|
-
|
8
|
-
Options:
|
9
|
-
|
10
|
-
new (or n) - Create a new project
|
11
|
-
|
12
|
-
init (or i) - Initialize a project in current folder
|
13
|
-
|
14
|
-
compile (or c) - Compile .sass, .coffee, .erb files (just once)
|
15
|
-
|
16
|
-
watch (or w) - Compile .sass, .coffee, .erb files (run the watcher).
|
17
|
-
|
18
|
-
help - Print this message
|
19
|
-
|
20
|
-
|
21
|
-
Informations:
|
22
|
-
|
23
|
-
Github - https://github.com/damln
|
24
|
-
|
25
|
-
Author - http://dln.name
|
26
|
-
|
27
|
-
Twitter - @damln
|
28
|
-
|
File without changes
|