cssdryer2 0.1.3 → 0.1.4
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.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/css_dryer_2/files_handler.rb +3 -3
- data/spec/lib/files_handler_spec.rb +22 -2
- metadata +2 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ module CssDryer2
|
|
10
10
|
|
11
11
|
def initialize(params = {})
|
12
12
|
|
13
|
-
@force_compile = false
|
13
|
+
@force_compile = params[:force_compile] || false
|
14
14
|
|
15
15
|
if params[:settings] == :rails
|
16
16
|
@source_path = "#{RAILS_ROOT}/public/stylesheets/ncss"
|
@@ -30,10 +30,10 @@ module CssDryer2
|
|
30
30
|
FileUtils.mkdir_p(@tmp_path + '/css_dryer_2') unless File.exist?(@tmp_path + '/css_dryer_2')
|
31
31
|
end
|
32
32
|
|
33
|
-
def run(
|
33
|
+
def run()
|
34
34
|
files = Dir.new(@source_path + '/').entries
|
35
35
|
files.delete_if { |f| !File.file?(@source_path + "/#{f}") or !(f =~ /.ncss$/) }
|
36
|
-
files.each { |f| prepare_file(f,
|
36
|
+
files.each { |f| prepare_file(f, @force_compile) }
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.configure
|
@@ -20,13 +20,33 @@ describe CssDryer2::FilesHandler do
|
|
20
20
|
|
21
21
|
file_handler = CssDryer2::FilesHandler.new(
|
22
22
|
:source_path => spec_root_dir,
|
23
|
-
:compile_path => Dir.tmpdir + '/css_dryer_2_gem/css'
|
23
|
+
:compile_path => Dir.tmpdir + '/css_dryer_2_gem/css',
|
24
|
+
:force_compile => true
|
24
25
|
)
|
25
26
|
|
26
|
-
file_handler.run(
|
27
|
+
file_handler.run()
|
27
28
|
Dir.new(Dir.tmpdir + '/css_dryer_2_gem/css').entries.should include('example.css')
|
28
29
|
end
|
29
30
|
|
31
|
+
it "forces compile when the flag is set" do
|
32
|
+
file_handler = CssDryer2::FilesHandler.new(
|
33
|
+
:source_path => spec_root_dir,
|
34
|
+
:compile_path => Dir.tmpdir + '/css_dryer_2_gem/css',
|
35
|
+
:force_compile => true
|
36
|
+
)
|
37
|
+
file_handler.should_receive(:prepare_file).with('example.ncss', true).once
|
38
|
+
file_handler.run
|
39
|
+
end
|
40
|
+
it "does not force compile if the flag is not set" do
|
41
|
+
file_handler = CssDryer2::FilesHandler.new(
|
42
|
+
:source_path => spec_root_dir,
|
43
|
+
:compile_path => Dir.tmpdir + '/css_dryer_2_gem/css',
|
44
|
+
:force_compile => false
|
45
|
+
)
|
46
|
+
file_handler.should_receive(:prepare_file).with('example.ncss', false).once
|
47
|
+
file_handler.run
|
48
|
+
end
|
49
|
+
|
30
50
|
after(:each) do
|
31
51
|
# cleaning up
|
32
52
|
FileUtils.rm_rf(Dir.tmpdir + '/css_dryer_2_gem')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cssdryer2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Snitko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-19 00:00:00 +04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|