less2sass 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95fdeec1c71530b7176ebd6fb35d23e837deac04
4
- data.tar.gz: ee8c5cc2e9174c5ac304a5d8fb444d07d4239200
3
+ metadata.gz: e3f02c49d9f8d91676e5b5054da9336edc07eeab
4
+ data.tar.gz: 2ac13011d142feaf033826a3d68e348fed0acf1e
5
5
  SHA512:
6
- metadata.gz: b1f59856e8879a6acca228fc7ffa7dc19e9d694bd72afe125e6ad1a6e34e150b4497a0c1f89f286400034b7bf59943330552bfb0f2bb9b316a63809af7620ca5
7
- data.tar.gz: b4000ab05781af2e9bf730f62be777db80a21f94b7d9730bb5ea6c610cab6a409f588fd845afaf4992383a5552cd2e028bef34a4a9d452dd624fdbe3d9a7ff7e
6
+ metadata.gz: 2c6ab95b3d9e200025ff3c772dd907369af6fc0d0d99df442e322fbab6f3d9663455bb369822630601bf188f2b8ee0f716f7df84768dd4d721bee09b24f7a8f3
7
+ data.tar.gz: 7b5db158afa8fb08a56761eda96e066c06c0264725a5d5da3b62f2e828e72e66e88ab1cda9883fdc7bf8e0bd4aa2f183334cb8ab59141aead4881d3a64b5e4d3
@@ -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.
@@ -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
- if input_file[-5, 5] == ".less"
42
- src = File.read input_file
43
- sass = Less2Sass.convert src
43
+ if input_file[-5, 5] == ".less"
44
+ src = File.read input_file
45
+ sass = Less2Sass.convert src
44
46
 
45
- if options[:print]
46
- puts sass
47
- exit unless options[:delete] || options[:outputfile]
48
- end
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
- if options[:outputfile] && options[:outputfilename][-5, 5] == ".scss"
51
- output_file = options[:outputfilename]
52
- else
53
- output_file = input_file.gsub(".less", ".scss")
54
- end
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
- File.open output_file, 'w' do |file|
57
- file << sass
58
- end
59
+ File.open output_file, 'w' do |file|
60
+ file << sass
61
+ end
59
62
 
60
- if File.file?(output_file)
61
- puts "Done: #{output_file}"
63
+ if File.file?(output_file)
64
+ puts "Done: #{output_file}"
62
65
 
63
- if options[:delete]
64
- File.delete(input_file)
66
+ if options[:delete]
67
+ File.delete(input_file)
65
68
 
66
- if File.file?(input_file) == false
67
- puts "Deleted: #{input_file}"
68
- else
69
- puts "Unable to delete: #{input_file}"
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
@@ -1,4 +1,4 @@
1
1
 
2
2
  class Less2Sass
3
- Version = '1.1.0'
3
+ Version = '1.2.0'
4
4
  end
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.1.0
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-04-12 00:00:00.000000000 Z
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.5.1
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