capucine 0.0.8 → 0.0.9

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -1,22 +1,3 @@
1
- =basic_responsive
2
- html
3
- -webkit-text-size-adjust: none
4
- -ms-text-size-adjust: none
5
-
6
- body *
7
- width: auto !important
8
- margin: auto !important
9
- padding: auto !important
10
-
11
- textarea, table, td, th, code, pre, samp
12
- word-wrap: break-word
13
-
14
- code, pre, samp
15
- white-space: pre-line
16
-
17
- img, table, td, blockquote, code, pre, textarea, input, iframe, object, embed, video
18
- max-width: 100% !important
19
-
20
1
  //----------[ MOBILE ONLY ]----
21
2
  @media only screen and (max-width: 767px) and (max-device-width: 1000px)
22
3
 
@@ -37,5 +18,3 @@
37
18
 
38
19
  //----------[ - 767px ]----
39
20
  @media only screen and (max-width: 767px)
40
-
41
- // +basic_responsive
@@ -1,5 +1,5 @@
1
- @import "compass/css3"
1
+ @import "compass"
2
2
  @import "sass-capucine"
3
3
 
4
- @import "shared"
4
+ @import "main"
5
5
  @import "responsive"
@@ -1,11 +1,12 @@
1
-
1
+
2
2
  </div>
3
3
  <script src="js/libs/jquery.min.js"></script>
4
- <script src="js_generated/app.min.js"></script>
4
+ <script src="js_generated/app.js"></script>
5
+ <!-- <script src="js_generated/app.min.js"></script> -->
6
+
5
7
  <!--[if lt IE 7 ]>
6
8
  <script defer src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
7
9
  <script defer>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
8
10
  <![endif]-->
9
11
  </body>
10
- </html>
11
-
12
+ </html>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <meta name="description" content="">
10
10
  <meta name="author" content="">
11
-
11
+
12
12
  <!-- <meta property="og:url" content=""/> -->
13
13
  <!-- <meta property="og:site_name" content=""/> -->
14
14
  <!-- <meta property="og:title" content=""/> -->
@@ -25,6 +25,6 @@
25
25
  <!-- <link rel="apple-touch-icon" href="images/favicon/apple-touch-icon-114x114-precomposed.png" sizes="114x114"> -->
26
26
  <link rel="stylesheet" href="css_generated/screen.css">
27
27
  </head>
28
- <body class="home_view">
29
- <div id="page_wrap" class="wrap">
30
-
28
+ <body>
29
+ <div class="wrap">
30
+
@@ -7,7 +7,7 @@ sass_images_dir: 'images'
7
7
  sass_files_dir: 'sass'
8
8
  sass_output_dir: 'css_generated'
9
9
  sass_line_comments: false
10
- sass_css_generated_style: 'compressed'
10
+ sass_css_generated_style: 'expanded' # compact | expanded | compressed
11
11
  sass_options: {cache: false}
12
12
  # compass_config:
13
13
  # '': ''
data/lib/commands.rb CHANGED
@@ -19,6 +19,10 @@ module Capucine
19
19
  Capucine::Watchr.compile second_arg
20
20
  elsif first_arg == 'watch' or first_arg == 'w'
21
21
  Capucine::Watchr.watch second_arg
22
+ elsif first_arg == 'clean'
23
+ Capucine::Tools.clean
24
+ elsif first_arg == 'update' or first_arg == 'u'
25
+ system('gem install capucine')
22
26
  else
23
27
  Capucine::Commands.help
24
28
  end
data/lib/compass-sass.rb CHANGED
@@ -4,7 +4,7 @@ module Capucine
4
4
  def self.update_plugins gems
5
5
  return if not gems
6
6
  gems.each do |plugin|
7
- begin
7
+ begin
8
8
  require "#{plugin}"
9
9
  rescue LoadError
10
10
  system("gem install #{plugin} --no-ri --no-rdoc")
@@ -12,12 +12,11 @@ module Capucine
12
12
  end
13
13
  end
14
14
 
15
-
16
15
  def self.update_config
17
16
  settings = Capucine.settings
18
17
  template_file = File.join settings.gem_content_dir, 'templates', 'compass_config.erb'
19
18
  output_file = File.join settings.working_dir, '.compass.rb'
20
-
19
+
21
20
  settings.config['compass_plugins_list'] = []
22
21
  plugins_gems = []
23
22
 
@@ -26,32 +25,32 @@ module Capucine
26
25
  if plugins.size > 0
27
26
  plugins.each do |key, value|
28
27
  settings.config['compass_plugins_list'].push key
29
-
28
+
30
29
  if value and value.length > 0
31
30
  plugins_gems.push value
32
31
  else
33
32
  plugins_gems.push key
34
33
  end
35
-
34
+
36
35
  end
37
36
  end
38
37
  config_ = settings.config
39
38
  result = Capucine::Tools.render_template template_file, config_
40
-
39
+
41
40
  f = File.open(output_file, 'w')
42
41
  f.write(result)
43
42
  f.close
44
-
43
+
45
44
  self.update_plugins plugins_gems
46
45
  end
47
-
46
+
48
47
  # def self.load_my_functions
49
48
  # rb_files = Dir.glob "#{Capucine.settings.working_dir}/#{Capucine.settings.config['compass_compass_files_dir']}/**/**.rb"
50
- #
49
+ #
51
50
  # rb_files.each do |file|
52
51
  # require "#{file}"
53
52
  # end
54
- #
53
+ #
55
54
  # end
56
55
 
57
56
  def self.import_css
@@ -62,15 +61,15 @@ module Capucine
62
61
 
63
62
  Dir.mkdir(import_dir) if not File.directory?(import_dir)
64
63
  Dir.mkdir(output_dir) if not File.directory?(output_dir)
65
-
64
+
66
65
  formats = s.config['sass_import_formats'].split
67
66
  from_format = formats[0]
68
67
  to_format = formats[2]
69
-
68
+
70
69
  command = "sass-convert -R --from #{from_format} --to #{to_format} #{import_dir} #{output_dir}"
71
70
  system(command)
72
71
  Capucine::Tools.archive_file import_dir
73
-
72
+
74
73
  end
75
74
 
76
75
  def self.run_once
@@ -107,5 +106,5 @@ module Capucine
107
106
  end
108
107
 
109
108
  end
110
-
109
+
111
110
  end
data/lib/incloudr.rb CHANGED
@@ -8,7 +8,7 @@ module Capucine
8
8
  def self.run_once
9
9
  files = Capucine.settings.config['incloudr_files']
10
10
  return if files.length == 0
11
-
11
+
12
12
  files.each do |base, files|
13
13
  self.pack base, files
14
14
  end
@@ -18,19 +18,19 @@ module Capucine
18
18
  def self.pack base = nil, files = []
19
19
  s = Capucine.settings
20
20
  out = File.join s.working_dir, s.config['incloudr_output_dir']
21
-
21
+
22
22
  output_file = File.join out, base
23
23
  output_file_min = File.join out, base.gsub('.js', '.min.js')
24
-
24
+
25
25
  FileUtils.mkdir_p out if not File.exist?(out)
26
-
26
+
27
27
  content = ""
28
28
 
29
29
  files.each do |js_file|
30
30
  extended = File.join s.working_dir, js_file
31
31
  content << File.read(extended) if File.exist?(extended)
32
32
  end
33
-
33
+
34
34
  f = File.open(output_file, 'w')
35
35
  f.write('')
36
36
  f.write(content)
@@ -47,7 +47,7 @@ module Capucine
47
47
  # output_file = "#{file_name}.js"
48
48
  # output_file_min = "#{file_name}.min.js"
49
49
  # end
50
-
50
+
51
51
  # def self.get_lib lib
52
52
  # lib_name = lib[0]
53
53
  # lib_version = lib[1]
data/lib/settings.rb CHANGED
@@ -1,18 +1,18 @@
1
1
  module Capucine
2
-
2
+
3
3
  class NoUserConfigFile < RuntimeError
4
4
  end
5
5
 
6
6
  class Settings
7
7
  require 'rubygems'
8
8
  require 'yaml'
9
-
10
- attr_accessor :current_dir, :project_name, :is_usable, :config, :gem_dir, :gem_content_dir, :working_dir
11
-
9
+
10
+ attr_accessor :current_dir, :project_name, :is_usable, :config, :gem_dir, :gem_content_dir, :working_dir, :external_config, :user_config_file
12
11
  def initialize
13
12
  @current_dir = File.expand_path Dir.pwd
14
13
  @project_name = 'capucine'
15
14
  @is_usable = false
15
+ @external_config = false
16
16
  @config = nil
17
17
  @gem_dir = Gem.loaded_specs[@project_name].full_gem_path
18
18
  @gem_content_dir = File.join @gem_dir, 'content'
@@ -21,45 +21,55 @@ module Capucine
21
21
  end
22
22
 
23
23
  def get_config user_config_file = nil
24
+ @user_config_file = user_config_file
24
25
  default = File.join @gem_content_dir, "templates", "#{@project_name}.yaml"
25
- @config = YAML::load(File.open(default))
26
+ @config = YAML::load(File.open(default))
27
+
28
+ if user_config_file
29
+ from_user = File.expand_path user_config_file
30
+ @external_config = true
31
+ @working_dir = File.dirname from_user
32
+ else
33
+ from_user = File.join @working_dir, "#{@project_name}.yaml"
34
+ end
26
35
 
27
- from_user = File.join @working_dir, "#{@project_name}.yaml"
28
- from_user = File.expand_path user_config_file if user_config_file
29
-
30
36
  raise NoUserConfigFile, caller if not File.exist? from_user
31
-
37
+
32
38
  @is_usable = true
33
39
  additional = YAML::load(File.open(from_user))
34
40
 
35
41
  if additional
36
42
  additional.each do |k, v|
37
- @config[k] = nil
38
43
  @config[k] = v
39
44
  end
40
45
  end
41
46
  #self.test_config
42
- end
47
+ end
43
48
 
44
49
  def test_config
45
50
  # TO DO :
46
- conf_dirs = []
51
+ conf_dirs = []
47
52
  dirs = []
48
53
  for conf in conf_dirs
49
54
  conf = @config[conf]
50
55
  dirs.push File.join(@working_dir,conf)
51
56
  end
52
-
57
+
53
58
  for dir in dirs
54
59
  unless File.directory?(dir)
55
60
  puts "[error] #{dir} - Does not exist."
56
61
  exit
57
62
  end
58
63
  end
59
- end
64
+ end
60
65
 
61
66
  def reset_working_dir
62
- @working_dir = File.expand_path Dir.pwd
67
+ if @external_config
68
+ from_user = File.expand_path @user_config_file
69
+ @working_dir = File.dirname from_user
70
+ else
71
+ @working_dir = File.expand_path Dir.pwd
72
+ end
63
73
  end
64
74
  end
65
75
  end
data/lib/tools.rb CHANGED
@@ -4,29 +4,34 @@ module Capucine
4
4
 
5
5
  class Tools
6
6
  require 'fileutils'
7
- require 'erb'
7
+ require 'erb'
8
8
  require "compass-sass.rb"
9
9
  require "coffeescript.rb"
10
10
  require "incloudr.rb"
11
11
  require "templates.rb"
12
-
12
+
13
13
  def self.new_project name = nil
14
-
15
- new_project_name = Capucine.settings.project_name
16
- new_project_name = name if name
14
+
15
+ if name
16
+ new_project_name = name
17
+ else
18
+ new_project_name = Capucine.settings.project_name
19
+ end
20
+
17
21
  Capucine.settings.working_dir = File.join Capucine.settings.current_dir, new_project_name
18
-
22
+
19
23
  self.archive_file Capucine.settings.working_dir
20
24
  FileUtils.mkdir Capucine.settings.working_dir if not File.directory? Capucine.settings.working_dir
21
-
25
+
22
26
  self.init files = true
23
27
  end
24
-
28
+
25
29
  def self.init all = nil
26
30
  files = []
27
31
  content_files = []
28
32
 
29
33
  self.archive_file File.join Capucine.settings.working_dir, 'capucine.yaml'
34
+
30
35
  if all
31
36
  content_files = Dir.glob("#{Capucine.settings.gem_content_dir}/shared/**")
32
37
  content_files.each do |file|
@@ -57,14 +62,14 @@ module Capucine
57
62
  is_dir = File.directory? path
58
63
  dir_length = Dir.glob("#{path}/**").length if is_dir
59
64
  is_empty = true if dir_length == 0
60
-
65
+
61
66
  return if is_empty
62
67
 
63
68
  date = Time.now.strftime("%Y-%m-%d_%Hh%Mm%Ss")
64
69
  new_dir_name = path
65
70
 
66
71
  if is_dir
67
- new_dir_name = "#{path}_#{date}"
72
+ new_dir_name = "#{path}_#{date}"
68
73
  end
69
74
 
70
75
  if not is_dir
@@ -73,20 +78,22 @@ module Capucine
73
78
  file_name = File.basename(path, extension)
74
79
  new_dir_name = File.join base_path, "#{file_name}_#{date}#{extension}"
75
80
  end
76
-
81
+
77
82
  FileUtils.mkdir_p new_dir_name if is_dir
78
83
  FileUtils.mv path, new_dir_name
79
84
 
80
85
  end
81
-
82
86
 
87
+ def self.clean
88
+ FileUtils.rm File.join(Capucine.settings.working_dir, '.compass.rb')
89
+ end
83
90
 
84
91
  def self.clean_name name
85
92
  require_relative 'extend_string'
86
93
  name.removeaccents
87
94
  name.urlize({:downcase => true, :convert_spaces => true})
88
95
  end
89
-
96
+
90
97
  end
91
98
  end
92
99
 
data/lib/watch.rb CHANGED
@@ -6,19 +6,19 @@ module Capucine
6
6
 
7
7
  def self.watch config_file = nil
8
8
  self.compile config_file
9
-
9
+
10
10
  if config_file
11
11
  Capucine.settings.get_config config_file
12
12
  else
13
13
  Capucine.settings.get_config
14
14
  end
15
-
15
+
16
16
  @config = Capucine.settings.config
17
-
17
+
18
18
  sass_proc = Capucine::CompassSass.proc_watch if @config['sass_enable']
19
19
  coffeescript_proc = Capucine::Coffee.proc_watch if @config['coffeescript_enable']
20
20
  templates_proc = Capucine::Templates.proc_watch if @config['templates_enable']
21
-
21
+
22
22
  sass_proc.join if sass_proc
23
23
  coffeescript_proc.join if coffeescript_proc
24
24
  templates_proc.join if templates_proc
@@ -26,13 +26,15 @@ module Capucine
26
26
 
27
27
  def self.compile config_file = nil
28
28
  if config_file
29
- Capucine.settings.get_config config_file
29
+ Capucine.settings.get_config config_file
30
30
  else
31
31
  Capucine.settings.get_config
32
32
  end
33
33
 
34
+ puts Capucine.settings.working_dir
35
+
34
36
  @config = Capucine.settings.config
35
-
37
+
36
38
  Capucine::CompassSass.run_once if @config['sass_enable']
37
39
  Capucine::Coffee.run_once if @config['coffeescript_enable']
38
40
  Capucine::Templates.run_once if @config['templates_enable']
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.8
4
+ version: 0.0.9
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: 2012-01-31 00:00:00.000000000Z
12
+ date: 2012-02-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fssm
16
- requirement: &70338907757860 !ruby/object:Gem::Requirement
16
+ requirement: &70113819608420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,32 +21,32 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70338907757860
24
+ version_requirements: *70113819608420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: compass
27
- requirement: &70338907777880 !ruby/object:Gem::Requirement
27
+ requirement: &70113819607900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
- - - ! '>='
30
+ - - =
31
31
  - !ruby/object:Gem::Version
32
- version: '0'
32
+ version: 0.12.rc.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70338907777880
35
+ version_requirements: *70113819607900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: coffee-script
38
- requirement: &70338907777460 !ruby/object:Gem::Requirement
38
+ requirement: &70113819607440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
- - - ! '>='
41
+ - - =
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: 2.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70338907777460
46
+ version_requirements: *70113819607440
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: uglifier
49
- requirement: &70338907777040 !ruby/object:Gem::Requirement
49
+ requirement: &70113819607060 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,32 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70338907777040
57
+ version_requirements: *70113819607060
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: packr
60
- requirement: &70338907776620 !ruby/object:Gem::Requirement
61
- none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
67
- prerelease: false
68
- version_requirements: *70338907776620
69
- - !ruby/object:Gem::Dependency
70
- name: term-ansicolor
71
- requirement: &70338907776200 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: *70338907776200
80
- - !ruby/object:Gem::Dependency
81
- name: zip
82
- requirement: &70338907775780 !ruby/object:Gem::Requirement
60
+ requirement: &70113819606640 !ruby/object:Gem::Requirement
83
61
  none: false
84
62
  requirements:
85
63
  - - ! '>='
@@ -87,10 +65,10 @@ dependencies:
87
65
  version: '0'
88
66
  type: :runtime
89
67
  prerelease: false
90
- version_requirements: *70338907775780
68
+ version_requirements: *70113819606640
91
69
  - !ruby/object:Gem::Dependency
92
70
  name: sass-capucine
93
- requirement: &70338907775360 !ruby/object:Gem::Requirement
71
+ requirement: &70113819606220 !ruby/object:Gem::Requirement
94
72
  none: false
95
73
  requirements:
96
74
  - - ! '>='
@@ -98,7 +76,7 @@ dependencies:
98
76
  version: '0'
99
77
  type: :runtime
100
78
  prerelease: false
101
- version_requirements: *70338907775360
79
+ version_requirements: *70113819606220
102
80
  description: Capucine, the missing tool for frontend developers.
103
81
  email: dam@dln.name
104
82
  executables:
@@ -116,8 +94,8 @@ files:
116
94
  - content/shared/images/favicon/favicon.png
117
95
  - content/shared/js/app.js
118
96
  - content/shared/js/libs/jquery.min.js
97
+ - content/shared/sass/_main.sass
119
98
  - content/shared/sass/_responsive.sass
120
- - content/shared/sass/_shared.sass
121
99
  - content/shared/sass/screen.sass
122
100
  - content/shared/templates/_footer.html
123
101
  - content/shared/templates/_header.html
@@ -155,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
133
  version: '0'
156
134
  requirements: []
157
135
  rubyforge_project:
158
- rubygems_version: 1.8.11
136
+ rubygems_version: 1.8.15
159
137
  signing_key:
160
138
  specification_version: 3
161
139
  summary: .
File without changes