baren 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/lib/baren.rb +21 -19
  3. metadata +7 -20
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ChangeLogs
2
2
  ==========
3
3
 
4
+ ## 0.2.1 (2011-06-05)
5
+
6
+ - Let Baren::PjsTemplate works on non-rails environment like sinatra
7
+
4
8
  ## 0.2.0 (2011-06-02)
5
9
 
6
10
  - Now try to install phantomjs on linux.
data/lib/baren.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "tilt"
2
- require "sprockets"
3
2
  module Baren
4
3
  class ProcessingJs
5
4
  def self.path
@@ -41,29 +40,32 @@ module Baren
41
40
  end
42
41
  #Tilt.register Baren::PjsTemplate, "pjs"
43
42
 
44
- # workaround for the problem about Sprockets::DirectiveProcessor parsing binary (png)
45
- class PossibleBinaryDirectiveProcessor < Sprockets::DirectiveProcessor
46
- def prepare
47
- if !data.respond_to?(:valid_encoding?) || data.valid_encoding?
48
- super
43
+ if defined?(::Rails::Railtie)
44
+ require "sprockets"
45
+ # workaround for the problem about Sprockets::DirectiveProcessor parsing binary (png)
46
+ class PossibleBinaryDirectiveProcessor < Sprockets::DirectiveProcessor
47
+ def prepare
48
+ if !data.respond_to?(:valid_encoding?) || data.valid_encoding?
49
+ super
50
+ end
49
51
  end
50
- end
51
52
 
52
- def evaluate(context, locals, &block)
53
- if @directive_parser
54
- super
55
- else
56
- data
53
+ def evaluate(context, locals, &block)
54
+ if @directive_parser
55
+ super
56
+ else
57
+ data
58
+ end
57
59
  end
58
60
  end
59
- end
60
61
 
61
- class Railtie < Rails::Railtie
62
- config.after_initialize do |app|
63
- app.assets.instance_eval do
64
- register_mime_type 'image/png', '.png'
65
- register_engine '.pjs', Baren::PjsTemplate
66
- register_processor 'image/png', Baren::PossibleBinaryDirectiveProcessor #Sprockets::DirectiveProcessor
62
+ class Railtie < ::Rails::Railtie
63
+ config.after_initialize do |app|
64
+ app.assets.instance_eval do
65
+ register_mime_type 'image/png', '.png'
66
+ register_engine '.pjs', Baren::PjsTemplate
67
+ register_processor 'image/png', Baren::PossibleBinaryDirectiveProcessor #Sprockets::DirectiveProcessor
68
+ end
67
69
  end
68
70
  end
69
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baren
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,31 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-05-31 00:00:00.000000000 +09:00
13
- default_executable:
12
+ date: 2011-06-05 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- name: railties
17
- requirement: &78401630 !ruby/object:Gem::Requirement
15
+ name: tilt
16
+ requirement: &9361500 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
21
20
  - !ruby/object:Gem::Version
22
- version: 3.1.0.rc1
21
+ version: '1.1'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *78401630
26
- - !ruby/object:Gem::Dependency
27
- name: sprockets
28
- requirement: &78401400 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: 2.0.0.beta.8
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: *78401400
24
+ version_requirements: *9361500
37
25
  description: An asset pipeline processor, and a template engine for images.
38
26
  email: hiroshi3110@gmail.com
39
27
  executables: []
@@ -46,7 +34,6 @@ files:
46
34
  - lib/baren.rb
47
35
  - opt/Rakefile
48
36
  - opt/phantomjs/pjs2png.js.erb
49
- has_rdoc: true
50
37
  homepage: http://github.com/hiroshi/baren
51
38
  licenses: []
52
39
  post_install_message:
@@ -67,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
54
  version: '0'
68
55
  requirements: []
69
56
  rubyforge_project:
70
- rubygems_version: 1.6.2
57
+ rubygems_version: 1.8.4
71
58
  signing_key:
72
59
  specification_version: 3
73
60
  summary: Generate .png form .pjs, processing.js script.