wisepdf 1.3.0 → 1.3.1

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: 288c2370873b268fb5a55b27a4cdaff3473151a4
4
- data.tar.gz: 31e755ac7b9360e6e408a4cb92b885e67cd5b895
3
+ metadata.gz: 1bbb4da340a936ac558e02fa3c49c5b0f63ea617
4
+ data.tar.gz: ebf72951aef4d1d5c3055251b46e4f985c69e32d
5
5
  SHA512:
6
- metadata.gz: a5a90a7598fc418c3295c3ebb4083c1d6d7f4bd5f3ad7cee7d375741b9fc1e40e606f91c6b1e7e212f2617a429346b47cc72c17df01571d1f92c6ab41f160acb
7
- data.tar.gz: 072eaf2a3d96a3fada410cf9aedf373ca4cfe847879e710e05b0931b5c7ad6db2388244582f54c6de8a6469cfec3f738a5cf7e01fd2416345a27028cef0f0170
6
+ metadata.gz: 0d3d1d4c7d73f6ba57043fb3ed1805bc6f6c1fcd667a9f8009a8244f70416114d1f01f7c21ae51c69851333cc2b09295ef806068d78fb61edf250c7a254ce1d6
7
+ data.tar.gz: 37018e359f484fca10198485d079dbb051f3fccf34526d0a161d8c9fec847db41da01b283daae6634a49a3215b73b606864902a22725286d898158ba0bc81cf1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wisepdf (1.3.0)
4
+ wisepdf (1.3.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
- [![Gem Version](https://badge.fury.io/rb/wisepdf.png)](http://badge.fury.io/rb/wiselinks)
2
- [![Build Status](https://travis-ci.org/igor-alexandrov/wisepdf.png?branch=master)](https://travis-ci.org/igor-alexandrov/wiselinks)
3
- [![Dependency Status](https://gemnasium.com/igor-alexandrov/wisepdf.png)](https://gemnasium.com/igor-alexandrov/wiselinks)
4
-
5
-
6
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/igor-alexandrov/wisepdf)
1
+ [![Build Status](https://travis-ci.org/igor-alexandrov/wisepdf.png)](https://travis-ci.org/igor-alexandrov/wisepdf)
2
+ [![Code Climate](https://codeclimate.com/github/igor-alexandrov/wisepdf.png)](https://codeclimate.com/github/igor-alexandrov/wisepdf)
3
+ [![Coverage Status](https://coveralls.io/repos/igor-alexandrov/wisepdf/badge.png)](https://coveralls.io/r/igor-alexandrov/wisepdf)
4
+ [![Dependency Status](https://gemnasium.com/igor-alexandrov/wisepdf.png)](https://gemnasium.com/igor-alexandrov/wisepdf)
5
+ [![Gem Version](https://badge.fury.io/rb/wisepdf.png)](http://badge.fury.io/rb/wisepdf)
7
6
 
8
7
  # wisepdf
9
8
 
@@ -21,6 +21,12 @@ module Wisepdf
21
21
  yield self
22
22
  end
23
23
 
24
+ def use_asset_pipeline?
25
+ return true if ::Rails.configuration.assets.enabled.nil?
26
+
27
+ !!(::Rails.configuration.assets.enabled)
28
+ end
29
+
24
30
  def reset!
25
31
  @options = {
26
32
  :encoding => "UTF-8",
@@ -3,7 +3,7 @@ module Wisepdf
3
3
  class Engine < ::Rails::Engine
4
4
  initializer "wise_pdf.register" do
5
5
  ActionController::Base.send :include, Render
6
- if !!(::Rails.configuration.assets.enabled)
6
+ if Wisepdf::Configuration.use_asset_pipeline?
7
7
  ActionView::Base.send :include, Helper::Assets
8
8
  else
9
9
  ActionView::Base.send :include, Helper::Legacy
@@ -4,7 +4,7 @@ module Wisepdf
4
4
  module Version
5
5
  MAJOR = 1
6
6
  MINOR = 3
7
- PATCH = 0
7
+ PATCH = 1
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -51,4 +51,25 @@ class ConfigurationTest < Test::Unit::TestCase
51
51
  assert_equal 15, Wisepdf::Configuration.options[:margin][:bottom]
52
52
  end
53
53
  end
54
+
55
+ context "Asset pipeline configuration" do
56
+ setup do
57
+ Wisepdf::Configuration.reset!
58
+ end
59
+
60
+ should "use the asset pipeline if assets.enabled is nil" do
61
+ ::Rails.configuration.assets.enabled = nil
62
+ assert(Wisepdf::Configuration.use_asset_pipeline?)
63
+ end
64
+
65
+ should "use the asset pipeline if assets.enabled is true" do
66
+ ::Rails.configuration.assets.enabled = true
67
+ assert(Wisepdf::Configuration.use_asset_pipeline?)
68
+ end
69
+
70
+ should "not use the asset pipeline if assets.enabled is false" do
71
+ ::Rails.configuration.assets.enabled = false
72
+ assert(!Wisepdf::Configuration.use_asset_pipeline?)
73
+ end
74
+ end
54
75
  end
@@ -5,6 +5,9 @@ ENV['RAILS_ENV'] = 'test'
5
5
  require "dummy/config/environment"
6
6
  require "rails/test_help"
7
7
 
8
+ require 'coveralls'
9
+ Coveralls.wear!
10
+
8
11
  begin
9
12
  Bundler.setup(:default, :development)
10
13
  rescue Bundler::BundlerError => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisepdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2013-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  requirements: []
292
292
  rubyforge_project:
293
- rubygems_version: 2.0.6
293
+ rubygems_version: 2.0.3
294
294
  signing_key:
295
295
  specification_version: 4
296
296
  summary: wkhtmltopdf for Rails done right
@@ -340,3 +340,4 @@ test_files:
340
340
  - test/helper_legacy_test.rb
341
341
  - test/parser_test.rb
342
342
  - test/writer_test.rb
343
+ has_rdoc: