bonsai 1.4.7 → 1.4.8

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/.rbenv-version ADDED
@@ -0,0 +1 @@
1
+ 1.9.3-p362
data/.travis.yml CHANGED
@@ -3,10 +3,8 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - jruby-18mode
7
- - jruby-19mode
8
6
  - rbx-18mode
9
-
7
+
10
8
  # These implementations are failing as of writing
11
9
  # - rbx-19mode # Has an encoding issue.
12
10
  # - ruby-head # Has a YAML parser issue.
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bonsai (1.4.6)
4
+ bonsai (1.4.8)
5
5
  activesupport (>= 3.0.3)
6
- bonsai
7
6
  builder (>= 3.0.0)
8
7
  i18n (>= 0.5.0)
9
8
  launchy (>= 0.3.7)
@@ -14,36 +13,33 @@ PATH
14
13
  sinatra (>= 1.0)
15
14
  tilt (>= 1.3)
16
15
  watch (>= 0.1.0)
16
+ yui-compressor
17
17
 
18
18
  GEM
19
19
  remote: http://rubygems.org/
20
20
  specs:
21
- activesupport (3.2.6)
21
+ POpen4 (0.1.4)
22
+ Platform (>= 0.4.0)
23
+ open4
24
+ Platform (0.4.0)
25
+ activesupport (3.2.11)
22
26
  i18n (~> 0.6)
23
27
  multi_json (~> 1.0)
24
- addressable (2.2.8)
25
- builder (3.0.0)
28
+ addressable (2.3.2)
29
+ builder (3.1.4)
26
30
  diff-lcs (1.1.3)
27
- git (1.2.5)
28
- i18n (0.6.0)
29
- jeweler (1.8.4)
30
- bundler (~> 1.0)
31
- git (>= 1.2.5)
32
- rake
33
- rdoc
34
- json (1.7.3)
35
- launchy (2.1.0)
36
- addressable (~> 2.2.6)
37
- liquid (2.3.0)
38
- maruku (0.6.0)
31
+ i18n (0.6.1)
32
+ launchy (2.1.2)
33
+ addressable (~> 2.3)
34
+ liquid (2.4.1)
35
+ maruku (0.6.1)
39
36
  syntax (>= 1.0.0)
40
- multi_json (1.3.6)
41
- rack (1.4.1)
42
- rack-protection (1.2.0)
37
+ multi_json (1.5.0)
38
+ open4 (1.3.0)
39
+ rack (1.4.4)
40
+ rack-protection (1.3.2)
43
41
  rack
44
42
  rake (0.8.7)
45
- rdoc (3.12)
46
- json (~> 1.4)
47
43
  rspec (2.8.0)
48
44
  rspec-core (~> 2.8.0)
49
45
  rspec-expectations (~> 2.8.0)
@@ -52,22 +48,23 @@ GEM
52
48
  rspec-expectations (2.8.0)
53
49
  diff-lcs (~> 1.1.2)
54
50
  rspec-mocks (2.8.0)
55
- sass (3.1.19)
56
- sinatra (1.3.2)
57
- rack (>= 1.3.6, ~> 1.3)
51
+ sass (3.2.5)
52
+ sinatra (1.3.3)
53
+ rack (~> 1.3, >= 1.3.6)
58
54
  rack-protection (~> 1.2)
59
- tilt (>= 1.3.3, ~> 1.3)
55
+ tilt (~> 1.3, >= 1.3.3)
60
56
  syntax (1.0.0)
61
57
  tilt (1.3.3)
62
58
  watch (0.1.0)
63
59
  yard (0.7.5)
60
+ yui-compressor (0.9.6)
61
+ POpen4 (>= 0.1.4)
64
62
 
65
63
  PLATFORMS
66
64
  ruby
67
65
 
68
66
  DEPENDENCIES
69
67
  bonsai!
70
- jeweler (= 1.8.4)
71
68
  rake
72
69
  rspec (~> 2.8.0)
73
70
  yard (~> 0.7.5)
data/bonsai.gemspec CHANGED
@@ -22,8 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "rspec", "~> 2.8.0"
23
23
  s.add_development_dependency "rake"
24
24
  s.add_development_dependency "yard", "~> 0.7.5"
25
- s.add_development_dependency "jeweler", "1.8.4"
26
- s.add_development_dependency "rdoc-data"
27
25
 
28
26
  s.add_dependency "rack"
29
27
  s.add_dependency "sinatra", ">= 1.0"
@@ -35,6 +33,7 @@ Gem::Specification.new do |s|
35
33
  s.add_dependency "launchy", ">= 0.3.7"
36
34
  s.add_dependency "activesupport", ">= 3.0.3"
37
35
  s.add_dependency "i18n", ">= 0.5.0"
36
+ s.add_dependency "yui-compressor"
38
37
  s.add_dependency "sass"
39
38
 
40
39
  s.post_install_message = %q{
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'sass'
3
+ require 'yui/compressor'
3
4
 
4
5
  module Bonsai
5
6
  class Exporter
@@ -36,15 +37,21 @@ module Bonsai
36
37
  end
37
38
 
38
39
  def compress_assets
39
- yui_compressor = File.expand_path("#{File.dirname(__FILE__)}/../../vendor/yui-compressor/yuicompressor-2.4.2.jar")
40
-
41
40
  Bonsai.log "Compressing javascript and stylesheets"
42
- Dir["#{path}/**/*.{js,css}"].each do |asset|
43
- system "java -jar #{yui_compressor} #{File.expand_path(asset)} -o #{File.expand_path(asset)}"
44
- end
41
+ compress_asset_path("#{path}/**/*.js", YUI::JavaScriptCompressor.new)
42
+ compress_asset_path("#{path}/**/*.css", YUI::CssCompressor.new)
45
43
  end
46
44
 
47
45
  protected
46
+ def compress_asset_path(paths, compressor)
47
+ Dir[paths].each do |path|
48
+ uncompressed = File.read(path)
49
+ File.open(path, "w") do |buffer|
50
+ buffer << compressor.compress(uncompressed)
51
+ end
52
+ end
53
+ end
54
+
48
55
  def teardown
49
56
  FileUtils.rm_rf path
50
57
  end
@@ -1,3 +1,3 @@
1
1
  module Bonsai
2
- VERSION = "1.4.7"
2
+ VERSION = "1.4.8"
3
3
  end
@@ -71,7 +71,7 @@ describe Bonsai::Exporter do
71
71
 
72
72
  # Compressed CSS
73
73
  it "should be processed with sass" do
74
- File.read("#{Bonsai::Exporter.path}/stylesheets/sassy.css").should == "#content{display:block;}"
74
+ File.read("#{Bonsai::Exporter.path}/stylesheets/sassy.css").should == "#content{display:block}"
75
75
  end
76
76
 
77
77
  it "should create the output directory" do
@@ -109,15 +109,11 @@ describe Bonsai::Exporter do
109
109
 
110
110
  describe "asset compression" do
111
111
  it "should compress the css file" do
112
- File.read("#{Bonsai::Exporter.path}/stylesheets/sassy.css").should == "#content{display:block;}"
113
- end
114
-
115
- it "should compress the css file" do
116
- File.read("#{Bonsai::Exporter.path}/stylesheets/sassy.css").should == "#content{display:block;}"
112
+ File.read("#{Bonsai::Exporter.path}/stylesheets/sassy.css").should == "#content{display:block}"
117
113
  end
118
114
 
119
115
  it "should compress the js file" do
120
- File.read("#{Bonsai::Exporter.path}/js/script.js").should == "$(function(){$(\".default-value\").each(function(){var a=this.value;$(this).focus(function(){if(this.value==a){this.value=\"\"}});$(this).blur(function(){if(this.value==\"\"){this.value=a}})});$(\".details dd:empty\").hide().prev(\"dt\").hide()});"
116
+ File.read("#{Bonsai::Exporter.path}/js/script.js").should == "$(function(){$(\".default-value\").each(function(){var default_value=this.value;$(this).focus(function(){if(this.value==default_value){this.value=\"\"}});$(this).blur(function(){if(this.value==\"\"){this.value=default_value}})});$(\".details dd:empty\").hide().prev(\"dt\").hide()});"
121
117
  end
122
118
  end
123
119
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bonsai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-01 00:00:00.000000000 Z
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -59,38 +59,6 @@ dependencies:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.7.5
62
- - !ruby/object:Gem::Dependency
63
- name: jeweler
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - '='
68
- - !ruby/object:Gem::Version
69
- version: 1.8.4
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - '='
76
- - !ruby/object:Gem::Version
77
- version: 1.8.4
78
- - !ruby/object:Gem::Dependency
79
- name: rdoc-data
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
62
  - !ruby/object:Gem::Dependency
95
63
  name: rack
96
64
  requirement: !ruby/object:Gem::Requirement
@@ -251,6 +219,22 @@ dependencies:
251
219
  - - ! '>='
252
220
  - !ruby/object:Gem::Version
253
221
  version: 0.5.0
222
+ - !ruby/object:Gem::Dependency
223
+ name: yui-compressor
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ! '>='
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
254
238
  - !ruby/object:Gem::Dependency
255
239
  name: sass
256
240
  requirement: !ruby/object:Gem::Requirement
@@ -278,6 +262,7 @@ files:
278
262
  - .bundle/config
279
263
  - .document
280
264
  - .gitignore
265
+ - .rbenv-version
281
266
  - .rspec
282
267
  - .rvmrc
283
268
  - .travis.yml
@@ -377,7 +362,6 @@ files:
377
362
  - spec/support/templates/images.liquid
378
363
  - spec/support/templates/partials/_inserted.liquid
379
364
  - spec/support/templates/partials/_magic.liquid
380
- - vendor/yui-compressor/yuicompressor-2.4.2.jar
381
365
  homepage: http://github.com/benschwarz/bonsai
382
366
  licenses: []
383
367
  post_install_message: ! "\n\n 盆栽\n bonsai, tiny and beautiful\n\n\n\n type
@@ -399,7 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
383
  version: '0'
400
384
  requirements: []
401
385
  rubyforge_project: bonsai
402
- rubygems_version: 1.8.24
386
+ rubygems_version: 1.8.23
403
387
  signing_key:
404
388
  specification_version: 3
405
389
  summary: A static site generator that uses the best toolset available