less2sass 1.1.0 → 1.2.0
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/CHANGELOG.md +5 -1
- data/README.md +13 -1
- data/bin/less2sass +36 -30
- data/lib/less2sass/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3f02c49d9f8d91676e5b5054da9336edc07eeab
|
4
|
+
data.tar.gz: 2ac13011d142feaf033826a3d68e348fed0acf1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c6ab95b3d9e200025ff3c772dd907369af6fc0d0d99df442e322fbab6f3d9663455bb369822630601bf188f2b8ee0f716f7df84768dd4d721bee09b24f7a8f3
|
7
|
+
data.tar.gz: 7b5db158afa8fb08a56761eda96e066c06c0264725a5d5da3b62f2e828e72e66e88ab1cda9883fdc7bf8e0bd4aa2f183334cb8ab59141aead4881d3a64b5e4d3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.2.0
|
2
|
+
|
3
|
+
[Multiple file conversion](https://github.com/brauliobo/less2sass#multiple-file-conversion) ([nicklayb](https://github.com/nicklayb))
|
4
|
+
|
1
5
|
## 1.1.0
|
2
6
|
|
3
7
|
Command-line options ([arubinofaux](https://github.com/arubinofaux))
|
@@ -8,4 +12,4 @@ Fixed mixin replacement ([swrobel](https://github.com/swrobel))
|
|
8
12
|
|
9
13
|
## 1.0.0
|
10
14
|
|
11
|
-
Initial release
|
15
|
+
Initial release
|
data/README.md
CHANGED
@@ -9,8 +9,16 @@ Sorry if the name causes any confusion but this gem doesn't currently output Sas
|
|
9
9
|
% gem install less2sass
|
10
10
|
|
11
11
|
### Usage
|
12
|
+
#### Single file conversion
|
13
|
+
|
12
14
|
% less2sass inputfile.less [options]
|
13
15
|
|
16
|
+
#### Multiple file conversion
|
17
|
+
|
18
|
+
% less2sass *.less [options]
|
19
|
+
|
20
|
+
% less2sass inputfile1.less inputfile2.less [options]
|
21
|
+
|
14
22
|
### Example
|
15
23
|
less2sass will output to inputfile.scss unless an alternative is given.
|
16
24
|
|
@@ -23,8 +31,12 @@ both examples will output to & overwrite `styles.scss`
|
|
23
31
|
|
24
32
|
| option | parameter | |
|
25
33
|
|--------------- |------------ |---------------------------- |
|
26
|
-
| -o, --output | FILE.scss | name of outputfile |
|
34
|
+
| -o, --output | FILE.scss | name of outputfile (Single file only) |
|
27
35
|
| -d, --delete | | delete inputfile after outputfile is created |
|
28
36
|
| -p, --print | | output sass results to the terminal |
|
29
37
|
| -v, --version | | print less2sass version |
|
30
38
|
| -h, --help | | print help |
|
39
|
+
|
40
|
+
### Docker Image
|
41
|
+
|
42
|
+
[This docker image](https://hub.docker.com/r/cthiebault/less2sass/) was created by [cthiebault](https://github.com/cthiebault) so that installation of Ruby on your base OS isn't required.
|
data/bin/less2sass
CHANGED
@@ -6,9 +6,10 @@ require_relative '../lib/less2sass/version'
|
|
6
6
|
options = {}
|
7
7
|
|
8
8
|
option_parser = OptionParser.new do |opts|
|
9
|
-
opts.banner = "Usage: less2sass inputfile.less [options]"
|
9
|
+
opts.banner = "Usage: less2sass inputfile.less [additional input files] [options]"
|
10
|
+
opts.banner += "\nSorry for the confusing name, but this actually converts less to scss\n\n"
|
10
11
|
|
11
|
-
opts.on("-o", "--output FILE.scss", "name of outputfile") do |o|
|
12
|
+
opts.on("-o", "--output FILE.scss", "name of outputfile (single file only)") do |o|
|
12
13
|
options[:outputfile] = true
|
13
14
|
options[:outputfilename] = o
|
14
15
|
end
|
@@ -37,43 +38,48 @@ if ARGV.size < 1
|
|
37
38
|
puts option_parser.help
|
38
39
|
else
|
39
40
|
input_file = ARGV[0]
|
41
|
+
ARGV.each do |input_file|
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
if input_file[-5, 5] == ".less"
|
44
|
+
src = File.read input_file
|
45
|
+
sass = Less2Sass.convert src
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
if options[:print]
|
48
|
+
puts "#{input_file}:" if ARGV.size > 1
|
49
|
+
puts sass
|
50
|
+
next unless options[:delete] || options[:outputfile]
|
51
|
+
end
|
49
52
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
if options[:outputfile] && options[:outputfilename][-5, 5] == ".scss" && ARGV.size == 1
|
54
|
+
output_file = options[:outputfilename]
|
55
|
+
else
|
56
|
+
output_file = input_file.gsub(".less", ".scss")
|
57
|
+
end
|
55
58
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
+
File.open output_file, 'w' do |file|
|
60
|
+
file << sass
|
61
|
+
end
|
59
62
|
|
60
|
-
|
61
|
-
|
63
|
+
if File.file?(output_file)
|
64
|
+
puts "Done: #{output_file}"
|
62
65
|
|
63
|
-
|
64
|
-
|
66
|
+
if options[:delete]
|
67
|
+
File.delete(input_file)
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
69
|
+
if File.file?(input_file) == false
|
70
|
+
puts "Deleted: #{input_file}"
|
71
|
+
else
|
72
|
+
puts "Unable to delete: #{input_file}"
|
73
|
+
end
|
70
74
|
end
|
71
75
|
end
|
76
|
+
else
|
77
|
+
puts "Error: #{input_file} is not a valid .less file"
|
78
|
+
if ARGV.size == 1
|
79
|
+
puts ""
|
80
|
+
puts option_parser.help
|
81
|
+
exit
|
82
|
+
end
|
72
83
|
end
|
73
|
-
else
|
74
|
-
puts "Error: #{input_file} is not a valid .less file"
|
75
|
-
puts ""
|
76
|
-
puts option_parser.help
|
77
|
-
exit
|
78
84
|
end
|
79
85
|
end
|
data/lib/less2sass/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: less2sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braulio Bhavamitra
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Don't be tricked by the name, this actually converts from Less to Scss
|
16
16
|
email:
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
48
48
|
rubyforge_project:
|
49
|
-
rubygems_version: 2.
|
49
|
+
rubygems_version: 2.6.4
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Convert Less file to a Scss file
|