itcss_cli 0.1.10 → 0.1.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c27a678c51c04c247c9dc9e0467ba1783be5a055
4
- data.tar.gz: 1fece74fc9bf3c0c66c14f0fc5eb405551d564a8
3
+ metadata.gz: 8d156c80913ebd8cf57faf5eb88bda789b140e5f
4
+ data.tar.gz: a20aee2ef19a0c9507d02044919c28c83a6e279a
5
5
  SHA512:
6
- metadata.gz: 632432d589d7c2c00a5948628520b790cc633c7d547b821978ba2bcf355d77f0284c007db1c639c6c23796b053a5b4935850dc643526a4bb5aa9210a3ab5b94c
7
- data.tar.gz: bdd706eb18ad6895d199ca975962192867cd6d68afe788072bb9bf3f9a6bd5f560c00b649d85e645c27d7c1607c75970af95bf69df26e0e4eb02cdeb7a098280
6
+ metadata.gz: e327c076db6b5ba27242b07c917e3d849f4aaac8c9d6ed29b18536e9d461902d069570e34820c0b0a1b271ca5f32ff0629b36d1936b6864accc5b9577d2408a1
7
+ data.tar.gz: 47752aa6296e254372597fbf765fb007f2fc99cdc8508ec3c7893c8fc8ea89f2ec492b4c2fb85c7c626d6d30fa360f5f732dada3d8807203523c5b81d2e86456
Binary file
Binary file
data/itcss_cli.gemspec CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = ["itcss"]
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "colorize"
22
-
23
21
  spec.add_development_dependency "bundler", "~> 1.11"
24
22
  spec.add_development_dependency "rake", "~> 10.0"
23
+
24
+ spec.add_runtime_dependency "colorize", "~> 0.7.7"
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module ItcssCli
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
data/lib/itcss_cli.rb CHANGED
@@ -11,7 +11,17 @@ module ItcssCli
11
11
  ITCSS_CONFIG_TEMPLATE = File.expand_path(File.join(File.dirname(__FILE__), "../templates/itcss_config.erb"))
12
12
  ITCSS_MODULE_TEMPLATE = File.expand_path(File.join(File.dirname(__FILE__), "../templates/itcss_module.erb"))
13
13
  ITCSS_APP_TEMPLATE = File.expand_path(File.join(File.dirname(__FILE__), "../templates/itcss_application.erb"))
14
- ITCSS_FILES = ["settings", "tools", "generic", "base", "objects", "components", "trumps"]
14
+ ITCSS_MODULES = ["settings", "tools", "generic", "base", "objects", "components", "trumps"]
15
+ ITCSS_FILES = {
16
+ "requirements" => "Vendor libraries",
17
+ "settings" => "Sass vars, etc.",
18
+ "tools" => "Functions and mixins.",
19
+ "generic" => "Generic, high-level styling, like resets, etc.",
20
+ "base" => "Unclasses HTML elements (e.g. `h2`, `ul`).",
21
+ "objects" => "Objects and abstractions.",
22
+ "components" => "Your designed UI elements (inuitcss includes none of these).",
23
+ "trumps" => "Overrides and helper classes."
24
+ }
15
25
 
16
26
  if File.exist?(ITCSS_CONFIG_FILE)
17
27
  ITCSS_CONFIG = YAML.load_file(ITCSS_CONFIG_FILE)
@@ -25,6 +35,12 @@ module ItcssCli
25
35
  if ITCSS_CONFIG.nil?
26
36
  puts "There's no #{ITCSS_CONFIG_FILE} created yet. Run `itcss init` to create it.".red
27
37
  abort
38
+ elsif ITCSS_DIR.nil? || ITCSS_BASE_FILE.nil?
39
+ puts "Something is wrong with your itcss.yml file. Please delete it and run `itcss init` again.".red
40
+ abort
41
+ elsif ITCSS_DIR == 'TODO' || ITCSS_BASE_FILE == 'TODO'
42
+ puts "You haven't done the itcss_cli's configuration. You must provide your directories settings in itcss.yml.".yellow
43
+ abort
28
44
  end
29
45
  end
30
46
 
@@ -44,9 +60,9 @@ module ItcssCli
44
60
  elsif ARGV[0] == 'new' && ARGV[1] && ARGV[2]
45
61
  init_checker
46
62
 
47
- occur = ITCSS_FILES.each_index.select{|i| ITCSS_FILES[i].include? ARGV[1]}
63
+ occur = ITCSS_MODULES.each_index.select{|i| ITCSS_MODULES[i].include? ARGV[1]}
48
64
  if occur.size == 1
49
- new_itcss_module(ITCSS_FILES[occur[0]], ARGV[2])
65
+ new_itcss_module(ITCSS_MODULES[occur[0]], ARGV[2])
50
66
  else
51
67
  puts "'#{ARGV[1]}' is not an ITCSS module. Try settings, tools, generic, base, objects, components or trumps.".red
52
68
  abort
@@ -55,6 +71,7 @@ module ItcssCli
55
71
 
56
72
  # $ itcss update
57
73
  if ARGV[0] == 'install' || ARGV[0] == 'new' || ARGV[0] == 'update'
74
+ init_checker
58
75
  generate_base_file
59
76
  end
60
77
  end
@@ -69,6 +86,7 @@ module ItcssCli
69
86
  end
70
87
  end
71
88
  puts "create #{ITCSS_CONFIG_FILE}".green
89
+ puts "Well done! Please do your own configurations in itcss.yml.".yellow
72
90
  else
73
91
  puts "#{ITCSS_CONFIG_FILE} already exists.".red
74
92
  abort
@@ -79,7 +97,7 @@ module ItcssCli
79
97
  File.open ITCSS_MODULE_TEMPLATE do |io|
80
98
  template = ERB.new io.read
81
99
 
82
- ITCSS_FILES.each do |file|
100
+ ITCSS_MODULES.each do |file|
83
101
  new_itcss_file(file, 'example', template)
84
102
  end
85
103
  end
@@ -111,7 +129,13 @@ module ItcssCli
111
129
  end
112
130
 
113
131
  def generate_base_file
114
- itcss_files = Dir[ File.join(ITCSS_DIR, '**', '*') ].reject { |p| File.directory? p }
132
+ FileUtils.mkdir_p ITCSS_DIR
133
+
134
+ itcss_files_to_import = {}
135
+ ITCSS_MODULES.each do |current_module|
136
+ itcss_module_files = Dir[ File.join("#{ITCSS_DIR}/#{current_module}/", '**', '*') ].reject { |p| File.directory? p }
137
+ itcss_files_to_import[current_module] = itcss_module_files.map{|s| s.gsub("#{ITCSS_DIR}/", '')}
138
+ end
115
139
 
116
140
  file_path = "#{ITCSS_DIR}/#{ITCSS_BASE_FILE}.sass"
117
141
  contents = "#{ITCSS_BASE_FILE}.sass"
@@ -1,6 +1,16 @@
1
+ @charset "utf-8"
2
+
1
3
  <%= "// " + "=" * 40 %>
2
4
  <%= "// " + contents %>
3
5
  <%= "// " + "=" * 40 %>
4
- <% itcss_files.each do |file| %>
5
- @import "<%= file.sub! "#{ITCSS_DIR}/", '' %>"
6
+
7
+ <% ITCSS_FILES.each_with_index do |value, index| %>
8
+ // [<%= index %>] <%= value[0].slice(0,1).capitalize + value[0].slice(1..-1) + " " + "-" * (15-value[0].length) + " " + value[1] %><% end %>
9
+
10
+ // ↓ ITCSS_CLI FILE IMPORTING ↓
11
+ <% itcss_files_to_import.each_with_index do |value, index| if value[1].length > 1 %>
12
+ // [<%= index %>] <%= value[0].slice(0,1).capitalize + value[0].slice(1..-1) %>
13
+ <% value[1].each do |file_path| %>@import "<%= file_path %>"
6
14
  <% end %>
15
+ <% end end %>
16
+ // ↑ ITCSS_CLI FILE IMPORTING ↑
@@ -2,5 +2,8 @@
2
2
  <%= "# #itcss.yml" %>
3
3
  <%= "# " + "=" * 40 %>
4
4
 
5
- stylesheets_directory: 'styleshets'
6
- stylesheets_import_file: 'application'
5
+ # Provide the root folder where the ITCSS file structure should be builded.
6
+ stylesheets_directory: 'TODO'
7
+
8
+ # Provide your base sass file (all ITCSS modules will be imported in it).
9
+ stylesheets_import_file: 'TODO'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itcss_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kande Bonfim
@@ -11,47 +11,47 @@ cert_chain: []
11
11
  date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: colorize
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
19
+ version: '1.11'
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.11'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.11'
40
+ version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: colorize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
48
- type: :development
47
+ version: 0.7.7
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: 0.7.7
55
55
  description:
56
56
  email:
57
57
  - kandebonfim@gmail.com
@@ -71,6 +71,7 @@ files:
71
71
  - bin/setup
72
72
  - itcss_cli-0.1.0.gem
73
73
  - itcss_cli-0.1.1.gem
74
+ - itcss_cli-0.1.10.gem
74
75
  - itcss_cli-0.1.2.gem
75
76
  - itcss_cli-0.1.3.gem
76
77
  - itcss_cli-0.1.4.gem
@@ -78,6 +79,7 @@ files:
78
79
  - itcss_cli-0.1.6.gem
79
80
  - itcss_cli-0.1.7.gem
80
81
  - itcss_cli-0.1.8.gem
82
+ - itcss_cli-0.1.9.gem
81
83
  - itcss_cli.gemspec
82
84
  - lib/itcss_cli.rb
83
85
  - lib/itcss_cli/version.rb