itcss_cli 0.1.12 → 0.1.13

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: 28404c509132024ac6b5bfc67ea6f54bc5dc38d0
4
- data.tar.gz: 476791a7913401775c8b13461eaf2234f07b2e2e
3
+ metadata.gz: 37df35d02e52c9edcb047e374dfcd9b27bafd851
4
+ data.tar.gz: c642c24d3a2144e6afda5c73ffbfeae86ad6a0ae
5
5
  SHA512:
6
- metadata.gz: 0fef028465b64e0ae78ee324270e08feea0a6f27582a7295044618113fe9be83b008968e7831bd73a9d377af4e912327367707546646a6a78978e432fccaee87
7
- data.tar.gz: 894d156bb6db774bc3908247d2e5784eda0a159d1ec89b7a215474377b297374e1f9d25dd29fb5f528043ba08924484bca8f37db5d9b3a80d1e1ee8530b19ea3
6
+ metadata.gz: 473cc79e3a7b63131248d03b7741fbe6daedc776a93e31ba5f8f81d2346610a9692d8da0c0e9120f8af936cbab210106a14e05c8674c9c8a9f1924e7be33b22f
7
+ data.tar.gz: 653898991ae995203e6628a3761269dbf1bb109dbc4cbf2d8162dfaa2a060ad9dbf3e6b2a2a8bb739ed3c33e2b78a4b25845ed86db58356eb1e296d69a0437b4
data/README.md CHANGED
@@ -1,9 +1,3 @@
1
- # ItcssCli
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/itcss_cli`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
1
  ## Installation
8
2
 
9
3
  Add this line to your application's Gemfile:
@@ -22,7 +16,102 @@ Or install it yourself as:
22
16
 
23
17
  ## Usage
24
18
 
25
- TODO: Write usage instructions here
19
+ First, you'll need to set up ITCSS by running:
20
+
21
+ $ itcss init
22
+
23
+ Now go to `itcss.yml` and define define where Itcss_cli should create the ITCSS structure and the name of it's base file:
24
+
25
+ ```yml
26
+ # Provide the root folder where the ITCSS file structure should be built.
27
+ stylesheets_directory: 'source/assets/stylesheets'
28
+
29
+ # Provide your base sass file (all ITCSS modules will be imported in it).
30
+ stylesheets_import_file: 'application.css'
31
+ ```
32
+
33
+ Go ahead and grow your ITCSS structure:
34
+ ```{r, engine='bash'}
35
+ $ itcss new component modals
36
+ create source/stylesheets/components/_components.modals.sass
37
+ update source/stylesheets/application.css.sass
38
+
39
+ $ itcss new trumps helpers
40
+ create source/stylesheets/trumps/_trumps.helpers.sass
41
+ update source/stylesheets/application.css.sass
42
+ ```
43
+
44
+ ## Example
45
+ Creating a full ITCSS structure:
46
+
47
+ ```{r, engine='bash'}
48
+ $ itcss init
49
+ create itcss.yml
50
+ Well done! Please do your own configurations in itcss.yml.
51
+
52
+ [[[ Open the `itcss.yml` file and edit it. ]]]
53
+
54
+ $ itcss install example
55
+ create source/stylesheets/settings/_settings.example.sass
56
+ create source/stylesheets/tools/_tools.example.sass
57
+ create source/stylesheets/generic/_generic.example.sass
58
+ create source/stylesheets/base/_base.example.sass
59
+ create source/stylesheets/objects/_objects.example.sass
60
+ create source/stylesheets/components/_components.example.sass
61
+ create source/stylesheets/trumps/_trumps.example.sass
62
+ update source/stylesheets/application.css.sass
63
+ ```
64
+
65
+ If you open the ITCSS's base file now, you'll see that all ITCSS modules are automatically imported into it:
66
+ ```sass
67
+ @charset "utf-8"
68
+
69
+ // ========================================
70
+ // application.css.sass
71
+ // ========================================
72
+
73
+
74
+ // [0] Requirements --- Vendor libraries
75
+ // [1] Settings ------- Sass vars, etc.
76
+ // [2] Tools ---------- Functions and mixins.
77
+ // [3] Generic -------- Generic, high-level styling, like resets, etc.
78
+ // [4] Base ----------- Unclasses HTML elements (e.g. `h2`, `ul`).
79
+ // [5] Objects -------- Objects and abstractions.
80
+ // [6] Components ----- Your designed UI elements (inuitcss includes none of these).
81
+ // [7] Trumps --------- Overrides and helper classes.
82
+
83
+ // ↓ ITCSS_CLI FILE IMPORTING ↓
84
+
85
+ // [0] Settings
86
+ @import "settings/_settings.example.sass"
87
+
88
+
89
+ // [1] Tools
90
+ @import "tools/_tools.example.sass"
91
+
92
+
93
+ // [2] Generic
94
+ @import "generic/_generic.example.sass"
95
+
96
+
97
+ // [3] Base
98
+ @import "base/_base.example.sass"
99
+
100
+
101
+ // [4] Objects
102
+ @import "objects/_objects.example.sass"
103
+
104
+
105
+ // [5] Components
106
+ @import "components/_components.example.sass"
107
+
108
+
109
+ // [6] Trumps
110
+ @import "trumps/_trumps.example.sass"
111
+
112
+
113
+ // ↑ ITCSS_CLI FILE IMPORTING ↑
114
+ ```
26
115
 
27
116
  ## Development
28
117
 
@@ -1,3 +1,3 @@
1
1
  module ItcssCli
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
data/lib/itcss_cli.rb CHANGED
@@ -23,6 +23,15 @@ module ItcssCli
23
23
  "trumps" => "Overrides and helper classes."
24
24
  }
25
25
 
26
+ ITCSS_COMMANDS = [
27
+ "itcss init | Initiates itcss_cli configuration with a itcss.yml file. [start here]",
28
+ "itcss install example | Creates an example of ITCSS structure in path specified in itcss.yml.",
29
+ "itcss new [module] [filename] | Creates a new ITCSS module and automatically import it into imports file.",
30
+ "itcss update | Updates the imports file using the files inside ITCSS structure.",
31
+ "itcss help | Shows all available itcss commands and it's functions.",
32
+ "itcss version | Shows itcss_cli gem version installed. [short-cut alias: '-v', 'v']"
33
+ ]
34
+
26
35
  if File.exist?(ITCSS_CONFIG_FILE)
27
36
  ITCSS_CONFIG = YAML.load_file(ITCSS_CONFIG_FILE)
28
37
  ITCSS_CONFIG['stylesheets_directory'].nil? ? ITCSS_DIR = nil : ITCSS_DIR = ITCSS_CONFIG['stylesheets_directory']
@@ -67,6 +76,16 @@ module ItcssCli
67
76
  puts "'#{ARGV[1]}' is not an ITCSS module. Try settings, tools, generic, base, objects, components or trumps.".red
68
77
  abort
69
78
  end
79
+
80
+
81
+ # $ itcss help
82
+ elsif ARGV[0] == 'help'
83
+ itcss_help
84
+
85
+
86
+ # $ itcss version
87
+ elsif ARGV[0] == 'version' || ARGV[0] == '-v' || ARGV[0] == 'v'
88
+ itcss_version
70
89
  end
71
90
 
72
91
  # $ itcss update
@@ -150,5 +169,14 @@ module ItcssCli
150
169
  puts "update #{file_path}".blue
151
170
  end
152
171
 
172
+ def itcss_help
173
+ puts "itcss_cli available commmands:".yellow
174
+ puts ITCSS_COMMANDS.map{|s| s.prepend(" ")}
175
+ end
176
+
177
+ def itcss_version
178
+ puts VERSION
179
+ end
180
+
153
181
  end
154
182
  end
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.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kande Bonfim