itcss_cli 0.1.5 → 0.1.6
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 +4 -4
- data/itcss_cli-0.1.5.gem +0 -0
- data/lib/itcss_cli.rb +12 -8
- data/lib/itcss_cli/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa8bb4c55b9b868071c5f56890c6abd89e6fb4a9
|
4
|
+
data.tar.gz: 3a14413e7bc8be23ac3ebf3074c9b8aed4610c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47d7c88a08e44818a4b9e3a095be75b563a7f5dab7c6972e885dcd1790f5be43df9e2cc7c23f660693401e8b0b915b0345fa041d32089c875037cfa347b3d51f
|
7
|
+
data.tar.gz: e39efef60c4fc928723c71de42795edeea1649a9d61a173761081b34bd0b0076c88eeddd49244cfc80e964f30ca733b6cd02e0144312d3a37b407efaf2422bac
|
data/itcss_cli-0.1.5.gem
ADDED
Binary file
|
data/lib/itcss_cli.rb
CHANGED
@@ -17,6 +17,7 @@ module ItcssCli
|
|
17
17
|
ITCSS_CONFIG = YAML.load_file(ITCSS_CONFIG_FILE)
|
18
18
|
ITCSS_CONFIG['stylesheets_directory'].nil? ? ITCSS_DIR = nil : ITCSS_DIR = ITCSS_CONFIG['stylesheets_directory']
|
19
19
|
ITCSS_CONFIG['stylesheets_import_file'].nil? ? ITCSS_BASE_FILE = nil : ITCSS_BASE_FILE = ITCSS_CONFIG['stylesheets_import_file']
|
20
|
+
File.chmod(777, ITCSS_DIR)
|
20
21
|
else
|
21
22
|
ITCSS_CONFIG = nil
|
22
23
|
end
|
@@ -51,9 +52,10 @@ module ItcssCli
|
|
51
52
|
puts "'#{ARGV[1]}' is not an ITCSS module. Try settings, tools, generic, base, objects, components or trumps.".red
|
52
53
|
abort
|
53
54
|
end
|
55
|
+
end
|
54
56
|
|
55
57
|
# $ itcss update
|
56
|
-
|
58
|
+
if ARGV[0] == 'install' || ARGV[0] == 'new' || ARGV[0] == 'update'
|
57
59
|
generate_base_file
|
58
60
|
end
|
59
61
|
end
|
@@ -95,14 +97,15 @@ module ItcssCli
|
|
95
97
|
FileUtils.mkdir_p ITCSS_DIR
|
96
98
|
FileUtils.mkdir_p "#{ITCSS_DIR}/#{type}"
|
97
99
|
|
98
|
-
|
100
|
+
file_path = "#{ITCSS_DIR}/#{type}/_#{type}.#{file}.sass"
|
101
|
+
unless File.exist?(file_path)
|
99
102
|
contents = "##{type}.#{file}"
|
100
|
-
File.open
|
103
|
+
File.open file_path, "w+" do |out|
|
101
104
|
out.puts template.result binding
|
102
105
|
end
|
103
|
-
puts "create
|
106
|
+
puts "create #{file_path}".green
|
104
107
|
else
|
105
|
-
puts "
|
108
|
+
puts "#{file_path} is already created. Please delete it if you want it to be rewritten.".red
|
106
109
|
abort
|
107
110
|
end
|
108
111
|
end
|
@@ -110,16 +113,17 @@ module ItcssCli
|
|
110
113
|
def generate_base_file
|
111
114
|
itcss_files = Dir[ File.join(ITCSS_DIR, '**', '*') ].reject { |p| File.directory? p }
|
112
115
|
|
116
|
+
file_path = "#{ITCSS_DIR}/#{ITCSS_BASE_FILE}.sass"
|
117
|
+
contents = "#{ITCSS_BASE_FILE}.sass"
|
113
118
|
File.open ITCSS_APP_TEMPLATE do |io|
|
114
119
|
template = ERB.new io.read
|
115
120
|
|
116
|
-
|
117
|
-
File.open "#{ITCSS_DIR}/#{ITCSS_BASE_FILE}.sass", "w+" do |out|
|
121
|
+
File.open file_path, "w+" do |out|
|
118
122
|
out.puts template.result binding
|
119
123
|
end
|
120
124
|
end
|
121
125
|
|
122
|
-
puts "update #{
|
126
|
+
puts "update #{file_path}".blue
|
123
127
|
end
|
124
128
|
|
125
129
|
end
|
data/lib/itcss_cli/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kande Bonfim
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- itcss_cli-0.1.2.gem
|
75
75
|
- itcss_cli-0.1.3.gem
|
76
76
|
- itcss_cli-0.1.4.gem
|
77
|
+
- itcss_cli-0.1.5.gem
|
77
78
|
- itcss_cli.gemspec
|
78
79
|
- lib/itcss_cli.rb
|
79
80
|
- lib/itcss_cli/version.rb
|