roger_yuicompressor 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjhlYzQ2NjU5MGU1NTI4MGI5YzE3NzdjMzFiZmY3OTgzMGE2NmViOQ==
4
+ MDIzZjQ5YjRkM2ZjY2Y0OWU1YjgzYTQ2MmQ3ZmZlZDk4NTExZTI4NA==
5
5
  data.tar.gz: !binary |-
6
- NzJiZWFjZTJhOWVmNTQwNDg1OTFkYTA5YWUxNDhlOWI2YjEwMDgwNQ==
6
+ NTgzMjk3NTZiYThlZGY1MmY3MTM5MzJiZmU0Mzg0ZDhkOTg2ZGEzNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTUxNDcxOTI0NDQ2OWE3MzcyYTkyMmUzMWFmNTcxNjk1OGYzZTQ4NTY3MTc2
10
- N2M5N2IyYTdhMjIwZDU0NDcxOWJjZTQ1NGY2MmMyYjRjODAxZWUzM2RiODhh
11
- MGZjMjY5MWY3ODFmZWY4NTQ3M2Q4NDRhYTljMDJjODI4MzY2MmI=
9
+ NjEwOTI5NmJjY2U1ZmYwODQzZDAzNWZmMzBlYmU1ODVjZTM3Yjc5Y2IwYjJi
10
+ ZDM2ODVhNDkxMmJlODVkNGNmNjQ5MDYwZTQ3MzkwMGI5M2Q3ZjM5NzdhZjJm
11
+ MjRlOGEyMThmOWQ0MTYzNjVhYjc4YjI4NzQzYTI4YjA5YTQxZDY=
12
12
  data.tar.gz: !binary |-
13
- YjE2NzFhM2I3YTVkMmY2ZjRlNjg2ZTkxZTZhMTJhMjMwOTk1OTUxODRjYThl
14
- YWJkNDhjNzI4ZmQyNWYxMWUzYjYzYTJmNmM1YTBhMWNkNzA0ZjcyYTcwNTI5
15
- MGY0YTc4MzE1ZmY4ZjI4ZWJmMGU0OGMyMzkwNTFmNjk1OTU2OGY=
13
+ ODQxMDI0OTBhZTQ3NjEyODAyNzFiNDI2MDUyYWU5NzRiODg3MmZhYTQ4NDVi
14
+ NTUzNmJhNTQ0ZWNlYzY0NmQ4MTY0YmNhOWEzZjk2YTMyZDFkODhmZGNmNzIy
15
+ NGQ5NzZkMTViMzRhMzgwMDE4NGMzNDU2YzBjYjI4MjRjYjM3YTE=
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.1.1
4
+ * Fixed typo-bugs in call-method of the processor, use default options and typo checking valid suffix
5
+ * Added test for call method
6
+
3
7
  ## Version 1.1.0
4
8
  * Add support for minifying files with a suffix without overwriting the original.
5
9
 
data/Gemfile CHANGED
@@ -2,4 +2,8 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rake"
5
+ gem "rake"
6
+
7
+ group :test do
8
+ gem "rspec-mocks"
9
+ end
data/Rakefile CHANGED
@@ -5,5 +5,5 @@ task :default => [:test]
5
5
  Rake::TestTask.new do |t|
6
6
  t.libs << "test"
7
7
  t.test_files = FileList['test/unit/**/*_test.rb']
8
- t.verbose = true
8
+ t.verbose = true
9
9
  end
@@ -33,12 +33,12 @@ module RogerYuicompressor
33
33
  def call(release, options={})
34
34
  @options.update(options)
35
35
 
36
- release.log self, "Minifying #{options[:match].inspect}"
36
+ release.log self, "Minifying #{@options[:match].inspect}"
37
37
 
38
- raise(RuntimeError, "The given suffix #{@options[:suffix]} is invalid.") unless valid_suffix?(@options[:sufix])
38
+ raise(RuntimeError, "The given suffix #{@options[:suffix]} is invalid.") unless valid_suffix?(@options[:suffix])
39
39
 
40
40
  # Add version numbers and minify the files
41
- release.get_files(options[:match], options[:skip]).each do |filename|
41
+ release.get_files(@options[:match], @options[:skip]).each do |filename|
42
42
  minify_file(filename, release)
43
43
  end
44
44
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "roger_yuicompressor"
5
- s.version = "1.1.0"
5
+ s.version = "1.1.1"
6
6
 
7
7
  s.authors = ["Flurin Egger"]
8
8
  s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
@@ -1,11 +1,13 @@
1
1
  require File.dirname(__FILE__) + "/../../lib/roger_yuicompressor/processor"
2
2
  require "test/unit"
3
+ require "rspec/mocks/standalone"
3
4
 
4
5
  class ProcessorTest < Test::Unit::TestCase
6
+ include RSpec::Mocks::ExampleMethods
5
7
 
6
8
  def setup
7
9
  @processor = RogerYuicompressor::Yuicompressor.new
8
- @tmp_file = 'file.css'
10
+ @tmp_file = 'file.css'
9
11
 
10
12
  # TEMP file creation
11
13
  File.open(@tmp_file, 'w') do |tmp_file|
@@ -51,8 +53,27 @@ class ProcessorTest < Test::Unit::TestCase
51
53
  assert(File.exists?('file.css'))
52
54
  end
53
55
 
56
+ def test_call_method
57
+ options = {:suffix => '.testsuffix', :match => ["file.css"]}
58
+ processor = RogerYuicompressor::Yuicompressor.new(options)
59
+
60
+ # Mock
61
+ release = double('Roger::Release')
62
+
63
+ # Expectations
64
+ expect(release).to receive(:log)
65
+ expect(release).to receive(:get_files).with(processor.options[:match], processor.options[:skip]).and_return(processor.options[:match])
66
+
67
+ # Call method
68
+ processor.call(release)
69
+
70
+ assert(File.exists?('file.testsuffix.css'), "File 'file.testsuffix.css' doesn't exist using Processor::Call method")
71
+ assert(File.exists?('file.css'), "File 'file.css' doesn't exist using Processor::Call method")
72
+ end
73
+
54
74
  def teardown
55
- File.delete('file.css') if File.exists?('file.css')
56
- File.delete('file.min.css') if File.exists?('file.min.css')
75
+ Dir['file.*.css', 'file.css'].each do |file|
76
+ File.delete(file)
77
+ end
57
78
  end
58
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger_yuicompressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-04 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roger
@@ -49,7 +49,6 @@ files:
49
49
  - .travis.yml
50
50
  - CHANGELOG.md
51
51
  - Gemfile
52
- - Gemfile.lock
53
52
  - LICENSE
54
53
  - README.md
55
54
  - Rakefile
@@ -1,32 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- roger_yuicompressor (1.0.1)
5
- roger (>= 0.11.0)
6
- yui-compressor
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- hpricot (0.8.6)
12
- mime-types (2.3)
13
- rack (1.5.2)
14
- rake (10.3.2)
15
- redcarpet (3.1.2)
16
- roger (0.12.2)
17
- hpricot (>= 0.6.4)
18
- mime-types (~> 2.2)
19
- rack (>= 1.0.0)
20
- redcarpet (>= 3.1.1)
21
- thor (~> 0.16.0)
22
- tilt (~> 2.0.1)
23
- thor (0.16.0)
24
- tilt (2.0.1)
25
- yui-compressor (0.12.0)
26
-
27
- PLATFORMS
28
- ruby
29
-
30
- DEPENDENCIES
31
- rake
32
- roger_yuicompressor!