sassconf 0.1.4 → 0.1.5

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: d32870a6e99e1673413ec41a335327bcd0207015
4
- data.tar.gz: 5420aa27ead9344a89638814775f37ecf64a129b
3
+ metadata.gz: 680e1904ad775caa81e4c706e348487c17eb519e
4
+ data.tar.gz: a581a9c6c1dc47fc20144c940ba6f0e73e9e31c5
5
5
  SHA512:
6
- metadata.gz: d420ca48106e55b740cb3b5bf803cf8c3134d095f0772eda642df5df8880356d83c6176fd65ec3df87756edf9b4b2b8c11b1dc36aad4988f0d712a96d2c1d2f4
7
- data.tar.gz: 32ca3216f5ff5ddea70cc336413ddc0bef9f238b81f974989209f7f7e61b55b7c5aee2bbdd8afa2af8fce360697961089a894480a2441d857b46cca00b56eeaf
6
+ metadata.gz: 4efdada8a4926789346e1712e8037889bc8e92c3d8df9d3e042e071bd42475a2cf8502984b27cbaba4188775b1608080c023a7ee8cab829826cbdff6c8a46b52
7
+ data.tar.gz: a453267953ca8b2d46672e5df40d21d2f5f3e4b4b2bbc3309ea315b880325da6c9138502d79a98f950f77f67a23a1a09e789787a6d39eebd8eb2174cde43a235
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  /pkg/
14
14
  /spec/reports/
15
15
  /tmp/
16
+ *.gem
data/README.md CHANGED
@@ -2,19 +2,34 @@ Sassconf
2
2
  ========
3
3
  [![Build Status](https://api.shippable.com/projects/555cfb27edd7f2c052f63ad8/badge?branchName=master)](https://app.shippable.com/projects/555cfb27edd7f2c052f63ad8/builds/latest)
4
4
  [![Gem Version](https://badge.fury.io/rb/sassconf.svg?style=flat-square)](http://badge.fury.io/rb/sassconf)
5
+ [![Code Climate](https://codeclimate.com/github/schlegel11/Sassconf/badges/gpa.svg)](https://codeclimate.com/github/schlegel11/Sassconf)
5
6
 
6
7
  With the Sassconf command tool you can use a config file for defining your [Sass](https://github.com/sass/sass) options.
7
8
  If you liked the config file in any Compass environment then you'll like that one also because it's very similar :)
8
9
 
10
+ ## ChangeLog
11
+ #### Version 0.1.5
12
+ - Fixed Exception handling.
13
+
14
+ - Improved syntax error handling.
15
+
16
+ - Add Feature live reloading of config file.
17
+
18
+ - Improved process handling.
19
+ - Childprocess handling on UNIX and MS-DOS.
20
+
21
+ - Improved log messages.
22
+
9
23
  ## Requirements
10
24
 
11
25
  - [Sass](https://github.com/sass/sass)
26
+ - [Filewatcher] (https://github.com/thomasfl/filewatcher)
12
27
 
13
28
  **Supported and tested ruby versions**
14
29
  - Ruby
15
30
  - 1.9.2 and up
16
31
  - JRuby
17
- - 1.7.18 and up
32
+ - 9.0.0.0.pre2 and up
18
33
 
19
34
  ## Installation
20
35
 
@@ -113,7 +128,11 @@ You can also set a list of values on the command line which you can use in your
113
128
  - -a, --args ARGS
114
129
  - Comma separated list of values e.g.: val_a, val_b,...
115
130
 
116
- - v, --verbose
131
+ - -r, --reload
132
+ - Watch config file for changes and reload it.
133
+ Useful if you are using "arg_watch" in your config.
134
+
135
+ - -v, --verbose
117
136
  - Print all log messages.
118
137
 
119
138
  - -?, -h, --help
@@ -151,7 +170,7 @@ You can also set a list of values on the command line which you can use in your
151
170
  **output.css**
152
171
  ```css
153
172
  .navigation {
154
- border-color: #3BBFCE;
173
+ border-color: #3BBECE;
155
174
  color: #2ca2af;
156
175
  }
157
176
  ```
@@ -183,6 +202,12 @@ You can also set a list of values on the command line which you can use in your
183
202
  sassconf -c ./config.rb
184
203
  ```
185
204
 
205
+ or with "live reloading":
206
+
207
+ ```bash
208
+ sassconf -c ./config.rb -r
209
+ ```
210
+
186
211
  **Console Output:**
187
212
  ```bash
188
213
  >>> Sass is watching for changes. Press Ctrl-C to stop.
@@ -195,7 +220,7 @@ You can also set a list of values on the command line which you can use in your
195
220
  **/out/input.css**
196
221
  ```css
197
222
  .navigation {
198
- border-color: #3BBFCE;
223
+ border-color: #3BBECE;
199
224
  color: #2ca2af;
200
225
  }
201
226
  ```
data/Rakefile CHANGED
@@ -7,5 +7,5 @@ Rake::TestTask.new(:test) do |test|
7
7
  test.test_files = FileList['test/test_*.rb']
8
8
  end
9
9
 
10
- desc "Run Tests"
10
+ desc 'Run Tests'
11
11
  task :default => :test
@@ -3,7 +3,7 @@ require_relative 'logger'
3
3
  require_relative 'core_extensions'
4
4
 
5
5
  module Sassconf
6
- class ConfigReader
6
+ class ConfigManager
7
7
  include Logging
8
8
 
9
9
  VARIABLE_PREFIX = 'arg_'
@@ -18,8 +18,21 @@ module Sassconf
18
18
  inject_array = 'extern_args = create_array_from_string(@bind_extern_string_array);'
19
19
  source_file = File.read(file_path)
20
20
  collect_variables = '@vh = create_variable_hash(local_variables, binding); @vwvh = create_variable_with_value_hash(local_variables, binding)'
21
- eval("#{inject_array} \n #{source_file} \n #{collect_variables}", reader_binding)
22
- nil
21
+ logger.info("Eval config file: #{file_path}")
22
+ eval_line = __LINE__ + 1
23
+ eval("#{inject_array} \n #{source_file} \n #{collect_variables}", reader_binding, file_path, __LINE__ - eval_line)
24
+ end
25
+
26
+ def watch_update(file_path, activate)
27
+ Util.pre_check(activate.is_boolean?, 'Activate is no boolean type.')
28
+ if (activate)
29
+ Util.pre_check((file_path.is_string? and file_path.is_not_nil_or_empty? and File.exist?(file_path)), "\"rb\" file path is no string, nil, empty or doesn't exist.")
30
+ FileWatcher.new([file_path]).watch do |filename, event|
31
+ if (event == :changed)
32
+ yield(filename)
33
+ end
34
+ end
35
+ end
23
36
  end
24
37
 
25
38
  def variable_hash
@@ -10,6 +10,10 @@ module Sassconf
10
10
  def is_hash?
11
11
  false
12
12
  end
13
+
14
+ def is_boolean?
15
+ false
16
+ end
13
17
  end
14
18
 
15
19
  module String
@@ -25,19 +29,16 @@ module Sassconf
25
29
  !(self.nil? || self.empty?)
26
30
  end
27
31
 
28
- def newline(count = 1, side = :right)
29
- count.times { side == :left ? self.insert(0, "\n") : self << "\n" }
30
- self << (block_given? ? yield : '')
32
+ def newline(count = 1, side = :right, &block)
33
+ base_manipulation("\n", count, side, &block)
31
34
  end
32
35
 
33
- def paragraph(count = 1, side = :right)
34
- count.times { side == :left ? self.insert(0, "\n\n") : self << "\n\n" }
35
- self << (block_given? ? yield : '')
36
+ def paragraph(count = 1, side = :right, &block)
37
+ base_manipulation("\n\n", count, side, &block)
36
38
  end
37
39
 
38
- def blank(count = 1, side = :right)
39
- count.times { side == :left ? self.insert(0, ' ') : self << ' ' }
40
- self << (block_given? ? yield : '')
40
+ def blank(count = 1, side = :right, &block)
41
+ base_manipulation(' ', count, side, &block)
41
42
  end
42
43
 
43
44
  module ClassMethods
@@ -45,6 +46,14 @@ module Sassconf
45
46
  ''
46
47
  end
47
48
  end
49
+
50
+ def base_manipulation(char, count, side)
51
+ count.times { side == :left ? self.insert(0, char) : self << char }
52
+ self << (block_given? ? yield : '')
53
+ end
54
+
55
+ module_function :base_manipulation
56
+
48
57
  end
49
58
 
50
59
  module Hash
@@ -52,17 +61,31 @@ module Sassconf
52
61
  true
53
62
  end
54
63
  end
64
+
65
+ module Boolean
66
+ def is_boolean?
67
+ true
68
+ end
69
+ end
55
70
  end
56
71
  end
57
72
 
58
73
  class Object
59
- include Sassconf::CoreExtensions::Object
74
+ include Sassconf::CoreExtensions::Object
60
75
  end
61
76
 
62
77
  class String
63
- include Sassconf::CoreExtensions::String
78
+ include Sassconf::CoreExtensions::String
64
79
  end
65
80
 
66
81
  class Hash
67
- include Sassconf::CoreExtensions::Hash
82
+ include Sassconf::CoreExtensions::Hash
83
+ end
84
+
85
+ class TrueClass
86
+ include Sassconf::CoreExtensions::Boolean
87
+ end
88
+
89
+ class FalseClass
90
+ include Sassconf::CoreExtensions::Boolean
68
91
  end
@@ -11,7 +11,7 @@ module Sassconf
11
11
  class << self
12
12
  @@active = false
13
13
 
14
- def activate()
14
+ def activate
15
15
  @@active = true
16
16
  end
17
17
 
@@ -1,3 +1,4 @@
1
+ require 'open3'
1
2
  require_relative 'util'
2
3
  require_relative 'core_extensions'
3
4
  require_relative 'logger'
@@ -30,7 +31,36 @@ module Sassconf
30
31
  def execute(argument_string)
31
32
  Util.pre_check((argument_string.is_string? and argument_string.is_not_nil_or_empty?), 'Argument string is no string, nil or empty.')
32
33
 
33
- system(SASS_PROCESS % [argument_string, @sass_input, @sass_output])
34
+ @pid = spawn(SASS_PROCESS % [argument_string, @sass_input, @sass_output])
35
+ logger.info("Spawn Sass process: #{@pid}")
36
+ end
37
+
38
+ def detach_and_kill
39
+ unless @pid.nil?
40
+ logger.info("Detach Sass process: #{@pid}")
41
+ Process.detach(@pid)
42
+ out, status = if Util.windows? then
43
+ logger.info("Find child processes on MS-DOS")
44
+ Open3.capture2("wmic process where (ParentProcessId=#{@pid.to_s}) get ProcessId")
45
+ else
46
+ logger.info("Find child processes on UNIX")
47
+ Open3.capture2('ps', 'h', '--ppid', @pid.to_s, '-o', 'pid')
48
+ end
49
+ logger.info("Kill process: #{@pid}")
50
+ Process.kill('KILL', @pid)
51
+ out.each_line do |elem|
52
+ pid = elem.to_i;
53
+ unless pid == 0
54
+ Process.kill('KILL', pid)
55
+ logger.info("Killed child process: #{pid}")
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ def wait
62
+ logger.info("Wait for Sass process: #{@pid}")
63
+ Process.wait(@pid) unless @pid.nil?
34
64
  end
35
65
 
36
66
  private
@@ -43,4 +73,4 @@ module Sassconf
43
73
  argument_hash.reduce('') { |arg_string, (key, value)| arg_string.concat((argument_type % [key, value])) }.strip
44
74
  end
45
75
  end
46
- end
76
+ end
data/lib/sassconf/util.rb CHANGED
@@ -1,8 +1,19 @@
1
1
  module Sassconf
2
2
  class Util
3
3
  def self.pre_check(term, message)
4
- raise ArgumentError, message if !term
4
+ raise ArgumentError, message unless term
5
5
  end
6
+
7
+ #Credits go to https://github.com/rdp/os
8
+ def self.windows?
9
+ if RUBY_PLATFORM =~ /cygwin/ # i386-cygwin
10
+ false
11
+ elsif ENV['OS'] == 'Windows_NT'
12
+ true
13
+ else
14
+ false
15
+ end
16
+ end
6
17
  end
7
18
  end
8
19
 
@@ -1,3 +1,3 @@
1
1
  module Sassconf
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
data/lib/sassconf.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'sassconf/version'
2
- require 'sassconf/config_reader'
2
+ require 'sassconf/config_manager'
3
3
  require 'sassconf/sass_executor'
4
4
  require 'optparse'
5
5
  require 'ostruct'
6
+ require 'filewatcher'
6
7
 
7
8
  module Sassconf
8
9
  extend Logging
@@ -14,6 +15,8 @@ module Sassconf
14
15
  DESCRIPTION = 'Description:'
15
16
  .newline.blank(3) { 'Adds configuration file to Sass preprocessor.' }
16
17
  .newline.blank(3) { "Version #{Sassconf::VERSION}" }
18
+ .newline.blank(3) {'Homepage: http://sassconf.schlegel11.de'}
19
+ .newline.blank(3) {'Email: develop@schlegel11.de'}
17
20
  .paragraph
18
21
  REQUIRED = 'Required:'
19
22
  OPTIONAL = 'Optional:'.newline(1, :left)
@@ -25,6 +28,7 @@ module Sassconf
25
28
  option_args = OpenStruct.new
26
29
  option_args.config_path = String.empty
27
30
  option_args.extern_args = String.empty
31
+ option_args.reload_active = false
28
32
 
29
33
  opt_parser = OptionParser.new do |opts|
30
34
  opts.banner = HelpText::USAGE
@@ -40,8 +44,12 @@ module Sassconf
40
44
  option_args.extern_args = elem
41
45
  end
42
46
 
47
+ opts.on('-r', '--reload', 'Watch config file for changes and reload it.', 'Useful if you are using "arg_watch" in your config.'.paragraph) do
48
+ option_args.reload_active = true
49
+ end
50
+
43
51
  opts.on('-v', '--verbose', 'Print all log messages.') do
44
- Sassconf::Logging.activate()
52
+ Sassconf::Logging.activate
45
53
  end
46
54
 
47
55
  opts.on('-?', '-h', '--help', 'Show this help. "Wow you really need this help?! ... Me too. ;)"') do
@@ -63,18 +71,31 @@ module Sassconf
63
71
  def self.start
64
72
  begin
65
73
  option_args = Parser.parse(ARGV)
66
- config_reader = ConfigReader.new
74
+ config_manager = ConfigManager.new
67
75
  executor = SassExecutor.new(ARGV[0], ARGV[1])
68
76
 
69
- config_reader.eval_rb_file(option_args.config_path, option_args.extern_args)
70
- argument_string = executor.create_all_argument_strings(config_reader.variable_with_value_hash, config_reader.variable_hash)
71
- executor.execute(argument_string)
77
+ Sassconf.eval_and_execute(config_manager, executor, option_args)
78
+
79
+ config_manager.watch_update(option_args.config_path, option_args.reload_active) do |filename|
80
+ logger.info("Config reload: #{filename}")
81
+ Sassconf.eval_and_execute(config_manager, executor, option_args)
82
+ puts "Config reloaded: #{filename}".newline(1, :left).paragraph
83
+ end
72
84
 
73
- rescue OptionParser::MissingArgument, OptionParser::InvalidOption, SyntaxError, ArgumentError => e
85
+ executor.wait
86
+ rescue StandardError, ScriptError => e
74
87
  puts e.message
75
88
  logger.error(e)
76
89
  ensure
77
90
  exit
78
91
  end
79
92
  end
93
+
94
+ def self.eval_and_execute(config_manager, sass_executor, option_args)
95
+ sass_executor.detach_and_kill
96
+ config_manager.eval_rb_file(option_args.config_path, option_args.extern_args)
97
+ argument_string = sass_executor.create_all_argument_strings(config_manager.variable_with_value_hash, config_manager.variable_hash)
98
+ sass_executor.execute(argument_string)
99
+ end
100
+
80
101
  end
data/sassconf.gemspec CHANGED
@@ -23,7 +23,8 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.required_ruby_version = '>= 1.9.2'
25
25
  spec.add_runtime_dependency 'sass', '>= 3.1.0'
26
+ spec.add_runtime_dependency 'filewatcher', '~> 0.5.1'
26
27
 
27
28
  spec.add_development_dependency 'rake', '~> 10.0'
28
- spec.add_development_dependency 'minitest', '>= 5.6.0'
29
+ spec.add_development_dependency 'minitest', '~> 5.6'
29
30
  end
data/shippable.yml CHANGED
@@ -9,8 +9,6 @@ rvm:
9
9
  - 2.1.0
10
10
  - 2.1.1
11
11
  - 2.1.2
12
- - jruby
13
- - jruby-19mode # JRuby in 1.9 mode
14
12
  - jruby-head
15
13
  - ruby-head
16
14
 
@@ -0,0 +1,5 @@
1
+ production = true
2
+ arg_no_cache =; :no_value
3
+ varg_style = production ? 'compressed' : 'no_production'
4
+ test_no_arg = 'no_arg'
5
+ varg_sourcemap = extern_args.empty? ? 'none' : extern_args[1]
@@ -1,50 +1,59 @@
1
1
  require 'minitest/autorun'
2
- require 'sassconf/config_reader'
2
+ require 'sassconf/config_manager'
3
3
 
4
4
  class TestConfigReader < Minitest::Test
5
5
  CONFIG_PATH = File.dirname(__FILE__) + '/resources/Config.rb'
6
+ ERROR_CONFIG_PATH = File.dirname(__FILE__) + '/resources/Error_Config.rb'
6
7
 
7
8
  # Called before every test method runs. Can be used
8
9
  # to set up fixture information.
9
10
  def setup
10
- @config_reader = Sassconf::ConfigReader.new
11
+ @config_manager = Sassconf::ConfigManager.new
11
12
  end
12
13
 
13
14
  def test_positive_eval_rb_file
14
- assert_equal(nil, @config_reader.variable_hash)
15
- assert_equal(nil, @config_reader.variable_with_value_hash)
15
+ assert_equal(nil, @config_manager.variable_hash)
16
+ assert_equal(nil, @config_manager.variable_with_value_hash)
16
17
 
17
- @config_reader.eval_rb_file(CONFIG_PATH)
18
+ @config_manager.eval_rb_file(CONFIG_PATH)
18
19
 
19
- assert_equal({'style' => 'compressed', 'sourcemap' => 'none'}, @config_reader.variable_with_value_hash)
20
- assert_equal({'no-cache' => :no_value}, @config_reader.variable_hash)
20
+ assert_equal({'style' => 'compressed', 'sourcemap' => 'none'}, @config_manager.variable_with_value_hash)
21
+ assert_equal({'no-cache' => :no_value}, @config_manager.variable_hash)
21
22
 
22
- @config_reader.eval_rb_file(CONFIG_PATH, 'dummy, inline ')
23
+ @config_manager.eval_rb_file(CONFIG_PATH, 'dummy, inline ')
23
24
 
24
- assert_equal({'style' => 'compressed', 'sourcemap' => 'inline'}, @config_reader.variable_with_value_hash)
25
- assert_equal({'no-cache' => :no_value}, @config_reader.variable_hash)
25
+ assert_equal({'style' => 'compressed', 'sourcemap' => 'inline'}, @config_manager.variable_with_value_hash)
26
+ assert_equal({'no-cache' => :no_value}, @config_manager.variable_hash)
26
27
  end
27
28
 
28
29
  def test_negative_eval_rb_file
29
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file('test/resources/Config_not_exist.rb') }
30
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file('test/resources/Config_not_exist.rb') }
30
31
  assert_equal("\"rb\" file path is no string, nil, empty or doesn't exist.", exception.message)
31
32
 
32
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file(String.empty) }
33
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file(String.empty) }
33
34
  assert_equal("\"rb\" file path is no string, nil, empty or doesn't exist.", exception.message)
34
35
 
35
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file(nil) }
36
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file(nil) }
36
37
  assert_equal("\"rb\" file path is no string, nil, empty or doesn't exist.", exception.message)
37
38
 
38
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file(0) }
39
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file(0) }
39
40
  assert_equal("\"rb\" file path is no string, nil, empty or doesn't exist.", exception.message)
40
41
 
41
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file(CONFIG_PATH, 0) }
42
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file(CONFIG_PATH, 0) }
42
43
  assert_equal('Extern string array is no string or nil.', exception.message)
43
44
 
44
- exception = assert_raises(ArgumentError) { @config_reader.eval_rb_file(CONFIG_PATH, nil) }
45
+ exception = assert_raises(ArgumentError) { @config_manager.eval_rb_file(CONFIG_PATH, nil) }
45
46
  assert_equal('Extern string array is no string or nil.', exception.message)
46
47
 
47
- assert_equal(nil, @config_reader.variable_with_value_hash)
48
- assert_equal(nil, @config_reader.variable_hash)
48
+ assert_equal(nil, @config_manager.variable_with_value_hash)
49
+ assert_equal(nil, @config_manager.variable_hash)
50
+
51
+ exception = assert_raises(SyntaxError) { @config_manager.eval_rb_file(ERROR_CONFIG_PATH) }
52
+ assert_includes(exception.message, ":2: syntax error, unexpected ';'\narg_no_cache =; :no_value\n")
53
+ end
54
+
55
+ def test_negative_watch_update
56
+ exception = assert_raises(ArgumentError) { @config_manager.watch_update(nil, 0) }
57
+ assert_equal('Activate is no boolean type.', exception.message)
49
58
  end
50
59
  end
@@ -1,6 +1,6 @@
1
1
  require 'minitest/autorun'
2
2
  require 'sassconf/sass_executor'
3
- require 'sassconf/config_reader'
3
+ require 'sassconf/config_manager'
4
4
 
5
5
  class TestSassExecuter < Minitest::Test
6
6
 
@@ -10,14 +10,14 @@ class TestSassExecuter < Minitest::Test
10
10
  # Called before every test method runs. Can be used
11
11
  # to set up fixture information.
12
12
  def setup
13
- @config_reader = Sassconf::ConfigReader.new
13
+ @config_manager = Sassconf::ConfigManager.new
14
14
  @sass_executor = Sassconf::SassExecutor.new(SCSS_PATH, CSS_PATH)
15
15
  end
16
16
 
17
17
  def test_positive_create_argument_with_value_string
18
- @config_reader.eval_rb_file(CONFIG_PATH)
18
+ @config_manager.eval_rb_file(CONFIG_PATH)
19
19
 
20
- assert_equal('--style=compressed --sourcemap=none', @sass_executor.create_argument_with_value_string(@config_reader.variable_with_value_hash))
20
+ assert_equal('--style=compressed --sourcemap=none', @sass_executor.create_argument_with_value_string(@config_manager.variable_with_value_hash))
21
21
  end
22
22
 
23
23
  def test_negative_create_argument_with_value_string
@@ -29,9 +29,9 @@ class TestSassExecuter < Minitest::Test
29
29
  end
30
30
 
31
31
  def test_positive_create_argument_string
32
- @config_reader.eval_rb_file(CONFIG_PATH)
32
+ @config_manager.eval_rb_file(CONFIG_PATH)
33
33
 
34
- assert_equal('--no-cache', @sass_executor.create_argument_string(@config_reader.variable_hash))
34
+ assert_equal('--no-cache', @sass_executor.create_argument_string(@config_manager.variable_hash))
35
35
  end
36
36
 
37
37
  def test_negative_create_argument_string
@@ -43,28 +43,29 @@ class TestSassExecuter < Minitest::Test
43
43
  end
44
44
 
45
45
  def test_positive_create_all_argument_strings
46
- @config_reader.eval_rb_file(CONFIG_PATH)
46
+ @config_manager.eval_rb_file(CONFIG_PATH)
47
47
 
48
- assert_equal('--style=compressed --sourcemap=none --no-cache', @sass_executor.create_all_argument_strings(@config_reader.variable_with_value_hash, @config_reader.variable_hash))
48
+ assert_equal('--style=compressed --sourcemap=none --no-cache', @sass_executor.create_all_argument_strings(@config_manager.variable_with_value_hash, @config_manager.variable_hash))
49
49
  end
50
50
 
51
51
  def test_negative_create_all_argument_strings
52
- exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(@config_reader.variable_with_value_hash, String.empty) }
52
+ exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(@config_manager.variable_with_value_hash, String.empty) }
53
53
  assert_equal('Argument hash is no hash or nil.', exception.message)
54
54
 
55
- exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(@config_reader.variable_with_value_hash, nil) }
55
+ exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(@config_manager.variable_with_value_hash, nil) }
56
56
  assert_equal('Argument hash is no hash or nil.', exception.message)
57
57
 
58
- exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(String.empty, @config_reader.variable_hash) }
58
+ exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(String.empty, @config_manager.variable_hash) }
59
59
  assert_equal('Argument hash is no hash or nil.', exception.message)
60
60
 
61
- exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(nil, @config_reader.variable_hash) }
61
+ exception = assert_raises(ArgumentError) { @sass_executor.create_all_argument_strings(nil, @config_manager.variable_hash) }
62
62
  assert_equal('Argument hash is no hash or nil.', exception.message)
63
63
  end
64
64
 
65
65
  def test_positive_execute
66
- @config_reader.eval_rb_file(CONFIG_PATH)
67
- @sass_executor.execute(@sass_executor.create_all_argument_strings(@config_reader.variable_with_value_hash, @config_reader.variable_hash))
66
+ @config_manager.eval_rb_file(CONFIG_PATH)
67
+ @sass_executor.execute(@sass_executor.create_all_argument_strings(@config_manager.variable_with_value_hash, @config_manager.variable_hash))
68
+ @sass_executor.wait
68
69
 
69
70
  assert_equal(".navigation{border-color:#3BBFCE;color:#2ca2af}\n", File.read(CSS_PATH))
70
71
 
@@ -72,7 +73,7 @@ class TestSassExecuter < Minitest::Test
72
73
  end
73
74
 
74
75
  def test_negative_execute
75
- @config_reader.eval_rb_file(CONFIG_PATH)
76
+ @config_manager.eval_rb_file(CONFIG_PATH)
76
77
 
77
78
  exception = assert_raises(ArgumentError) { @sass_executor.execute(0) }
78
79
  assert_equal('Argument string is no string, nil or empty.', exception.message)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassconf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Schlegel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-22 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: filewatcher
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.5.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +56,16 @@ dependencies:
42
56
  name: minitest
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ">="
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 5.6.0
61
+ version: '5.6'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ">="
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 5.6.0
68
+ version: '5.6'
55
69
  description: |-
56
70
  With the Sassconf command tool you can use a config file for defining your Sass options.
57
71
  If you liked the config file in any Compass environment then you'll like that one also because it's very similar.
@@ -68,7 +82,7 @@ files:
68
82
  - Rakefile
69
83
  - bin/sassconf
70
84
  - lib/sassconf.rb
71
- - lib/sassconf/config_reader.rb
85
+ - lib/sassconf/config_manager.rb
72
86
  - lib/sassconf/core_extensions.rb
73
87
  - lib/sassconf/logger.rb
74
88
  - lib/sassconf/sass_executor.rb
@@ -77,6 +91,7 @@ files:
77
91
  - sassconf.gemspec
78
92
  - shippable.yml
79
93
  - test/resources/Config.rb
94
+ - test/resources/Error_Config.rb
80
95
  - test/resources/Input.scss
81
96
  - test/test_config_reader.rb
82
97
  - test/test_sass_executor.rb