sprockets-rails 2.0.0 → 2.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d271ba7763932c67dc00e93a3d19edf2ff7ffb4
4
- data.tar.gz: 82c38b9ef100ad90cb8dbd44a5b27547269d8c1d
3
+ metadata.gz: 79800fc588c2c61e6edab3f2eba4a305753f3d1d
4
+ data.tar.gz: 38604ce2a233554c6c5562b9640468d0235d8dba
5
5
  SHA512:
6
- metadata.gz: 6920457524ba530f05b148d7e4be9b4d75a73052e1fd511ac442555a011b70d1ae04c646ea8e090f444dd4439fe04105990fecb93ebf69d42ee530e3df4da267
7
- data.tar.gz: f8ab08f41162fab0a1565405d58f77967ab6bc83b1ccf733a2fc88f3c7c984d5640f66a2c4473770019e01bd1debdbbc504d51fdab3b81ea9d7c880b5abb1305
6
+ metadata.gz: d74ea9be777f07327e05acf7031245bd913d35b1b99afa287196170809e48b79fac6961289ec8cb39243285a74759ddb5b3d0b0c1c3a9fb73c2b0efdb71a07a2
7
+ data.tar.gz: 695ebd483f3e8e8a87eb58cf0d429442223090e688a3ca2d66ce16b74fc6310e07cb42b52f44b8b5e1895d88f8e03a0383e0043ebad972a6754a70469954da77
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Joshua Peek
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -46,7 +46,7 @@ end
46
46
 
47
47
  Each asset task will invoke `assets:environment` first. By default this loads the Rails environment. You can override this task to add or remove dependencies for your specific compilation environment.
48
48
 
49
- Also see [Sprockest::Rails::Task](https://github.com/josh/sprockets-rails/blob/master/lib/sprockets/rails/task.rb) and [Rake::SprocketsTask](https://github.com/sstephenson/sprockets/blob/master/lib/rake/sprocketstask.rb).
49
+ Also see [Sprockets::Rails::Task](https://github.com/josh/sprockets-rails/blob/master/lib/sprockets/rails/task.rb) and [Rake::SprocketsTask](https://github.com/sstephenson/sprockets/blob/master/lib/rake/sprocketstask.rb).
50
50
 
51
51
 
52
52
  ### Initializer options
@@ -83,7 +83,7 @@ Enable expanded asset debugging mode. Individual files will be served to make re
83
83
 
84
84
  **`config.assets.compile`**
85
85
 
86
- Enables Sprockest compile environment. If disabled, `Rails.application.assets` will be unavailable to any ActionView helpers. View helpers will depend on assets being precompiled to `public/assets` in order to link to them. You can still access the environment by directly calling `Rails.application.assets`.
86
+ Enables Sprockets compile environment. If disabled, `Rails.application.assets` will be unavailable to any ActionView helpers. View helpers will depend on assets being precompiled to `public/assets` in order to link to them. You can still access the environment by directly calling `Rails.application.assets`.
87
87
 
88
88
  **`config.assets.configure`**
89
89
 
@@ -7,6 +7,7 @@ module Sprockets
7
7
  module Helper
8
8
  if defined? ActionView::Helpers::AssetUrlHelper
9
9
  include ActionView::Helpers::AssetUrlHelper
10
+ include ActionView::Helpers::AssetTagHelper
10
11
  else
11
12
  require 'sprockets/rails/legacy_asset_tag_helper'
12
13
  require 'sprockets/rails/legacy_asset_url_helper'
@@ -22,7 +23,7 @@ module Sprockets
22
23
  klass.class_eval do
23
24
  alias_method :assets_environment, :environment
24
25
  def assets_manifest; end
25
- class_attribute :config, :assets_prefix, :digest_assets
26
+ class_attribute :config, :assets_prefix, :digest_assets, :debug_assets
26
27
  end
27
28
  else
28
29
  klass.class_attribute(*VIEW_ACCESSORS)
@@ -85,7 +86,7 @@ module Sprockets
85
86
  def javascript_include_tag(*sources)
86
87
  options = sources.extract_options!.stringify_keys
87
88
 
88
- if request_debug_assets?
89
+ if options["debug"] != false && request_debug_assets?
89
90
  sources.map { |source|
90
91
  if asset = lookup_asset_for_path(source, :type => :javascript)
91
92
  asset.to_a.map do |a|
@@ -107,7 +108,7 @@ module Sprockets
107
108
  def stylesheet_link_tag(*sources)
108
109
  options = sources.extract_options!.stringify_keys
109
110
 
110
- if request_debug_assets?
111
+ if options["debug"] != false && request_debug_assets?
111
112
  sources.map { |source|
112
113
  if asset = lookup_asset_for_path(source, :type => :stylesheet)
113
114
  asset.to_a.map do |a|
@@ -128,6 +129,8 @@ module Sprockets
128
129
  # and replaced by source maps in Sprockets 3.x.
129
130
  def request_debug_assets?
130
131
  debug_assets || (defined?(controller) && controller && params[:debug_assets])
132
+ rescue
133
+ return false
131
134
  end
132
135
 
133
136
  # Internal method to support multifile debugging. Will
@@ -62,7 +62,8 @@ module Sprockets
62
62
  end
63
63
 
64
64
  desc "Remove old compiled assets"
65
- task :clean => :environment do
65
+ task :clean, [:keep] => :environment do |t, args|
66
+ keep = Integer(args.keep || 2)
66
67
  with_logger do
67
68
  manifest.clean(keep)
68
69
  end
@@ -36,8 +36,8 @@ end
36
36
 
37
37
  module Sprockets
38
38
  class Railtie < ::Rails::Railtie
39
- LOOSE_APP_ASSETS = lambda do |path, filename|
40
- filename =~ /app\/assets/ && !%w(.js .css).include?(File.extname(path))
39
+ LOOSE_APP_ASSETS = lambda do |filename, path|
40
+ path =~ /app\/assets/ && !%w(.js .css).include?(File.extname(filename))
41
41
  end
42
42
 
43
43
  class OrderedOptions < ActiveSupport::OrderedOptions
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-11 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -79,8 +79,10 @@ files:
79
79
  - lib/sprockets/rails/task.rb
80
80
  - lib/sprockets/rails.rb
81
81
  - lib/sprockets/railtie.rb
82
+ - LICENSE
82
83
  homepage: https://github.com/rails/sprockets-rails
83
- licenses: []
84
+ licenses:
85
+ - MIT
84
86
  metadata: {}
85
87
  post_install_message:
86
88
  rdoc_options: []
@@ -98,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
100
  version: '0'
99
101
  requirements: []
100
102
  rubyforge_project:
101
- rubygems_version: 2.0.2
103
+ rubygems_version: 2.0.6
102
104
  signing_key:
103
105
  specification_version: 4
104
106
  summary: Sprockets Rails integration