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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea154784e23c6a08385db6353432199f5775796b
4
- data.tar.gz: f51d7a1b8c3049f4688bdd0a5f5f0f5b3e0eded1
3
+ metadata.gz: fa8bb4c55b9b868071c5f56890c6abd89e6fb4a9
4
+ data.tar.gz: 3a14413e7bc8be23ac3ebf3074c9b8aed4610c64
5
5
  SHA512:
6
- metadata.gz: 0de32800b48ef55863416a7942e5f8713baf8484a4dd6b504eca6fa0429b6fb87dd73d29ca9b08698f02092e3dd08f1069008a493a1e061b670cd35eea8e712e
7
- data.tar.gz: 0baa7860c0a2402132928e252ee168aa87bf5bacc174ff161eacf3c5e9a2ae57b33f150eb1d71cef22460451a46628c3973a0712b1b6d6d7df7cc9e443f32e51
6
+ metadata.gz: 47d7c88a08e44818a4b9e3a095be75b563a7f5dab7c6972e885dcd1790f5be43df9e2cc7c23f660693401e8b0b915b0345fa041d32089c875037cfa347b3d51f
7
+ data.tar.gz: e39efef60c4fc928723c71de42795edeea1649a9d61a173761081b34bd0b0076c88eeddd49244cfc80e964f30ca733b6cd02e0144312d3a37b407efaf2422bac
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
- elsif ARGV[0] == 'install' || ARGV[0] == 'new' || ARGV[0] == 'update'
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
- unless File.exist?("#{ITCSS_DIR}/#{type}/_#{type}.#{file}.sass")
100
+ file_path = "#{ITCSS_DIR}/#{type}/_#{type}.#{file}.sass"
101
+ unless File.exist?(file_path)
99
102
  contents = "##{type}.#{file}"
100
- File.open "#{ITCSS_DIR}/#{type}/_#{type}.#{file}.sass", "w+" do |out|
103
+ File.open file_path, "w+" do |out|
101
104
  out.puts template.result binding
102
105
  end
103
- puts "create /#{type}/_#{type}.#{file}.sass".green
106
+ puts "create #{file_path}".green
104
107
  else
105
- puts "/#{type}/_#{type}.#{file}.sass is already created. Please delete it if you want it to be rewritten.".red
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
- contents = "#{ITCSS_BASE_FILE}.sass"
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 #{ITCSS_BASE_FILE}.sass".blue
126
+ puts "update #{file_path}".blue
123
127
  end
124
128
 
125
129
  end
@@ -1,3 +1,3 @@
1
1
  module ItcssCli
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  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.5
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