sprockets-helpers-nonexistent 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 137a20a3ce9d1329ac1334f9e7a5eba1dd0d3569
4
+ data.tar.gz: 1e084b20013cbaa1f687eeab33f287c2532b8a7c
5
+ SHA512:
6
+ metadata.gz: 7efa887f8dd8d704710a7c3bfbda4535b1c0a0fa5e8c527a16295e5ca59ab7d43cfb320363aa6d2ffc1ce31154cda325f73c9d307bc7efb7c0c84f2b27936ef9
7
+ data.tar.gz: 20f73de223a971b22e45a5f5be53e8c252b6aca64242b775b8fcc473468ec63739c05ccee2f3edb15d94d28d33874ed86050330853ea6aaa478a38bedafd3c1b
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sprockets-helpers-nonexistent.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 h3poteto
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Sprockets::Helpers::Nonexistent
2
+
3
+ Notify nonexsistent stylesheet or javascript through sprockets-rails.
4
+ When you use `stylesheet_link_tag` or `javascript_include_tag` in development or test, rails continues rendering if those asset files don't exist.
5
+ But that cause error in production, for example `isn't precompiled`.
6
+
7
+ This gem can use Rails3.2. If you want to use this gem in Rails4.x, please use [sprockets-rails-nonexistent](https://github.com/h3poteto/sprockets-rails-nonexistent).
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'sprockets-helpers-nonexistent'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install sprockets-helpers-nonexistent
24
+
25
+ ## Usage
26
+
27
+ You can use `stylesheet_link_tag` and `javascript_include_tag` same as before.
28
+ When sprockets can not find stylesheet or javascript, raise error in development and test.
29
+
30
+ ## Contributing
31
+
32
+ 1. Fork it ( https://github.com/h3poteto/sprockets-helpers-nonexistent/fork )
33
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
34
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
35
+ 4. Push to the branch (`git push origin my-new-feature`)
36
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
@@ -0,0 +1,23 @@
1
+ require "sprockets/helpers/nonexistent/version"
2
+
3
+ require 'sprockets/helpers'
4
+
5
+ module Sprockets::Helpers::RailsHelper
6
+ def self.stylesheet_link_tag(*sources)
7
+ sources.each do |stylesheet|
8
+ unless stylesheet.kind_of?(Hash)
9
+ raise Sprockets::FileNotFound, "#{stylesheet}.css" if (Rails.env.development? || Rails.env.test?) && asset_paths.asset_for(stylesheet, "css").blank?
10
+ end
11
+ end
12
+ super
13
+ end
14
+
15
+ def self.javascript_include_tag(*sources)
16
+ sources.each do |javascript|
17
+ unless javascript.kind_of?(Hash)
18
+ raise Sprockets::FileNotFound, "#{javascript}.js" if (Rails.env.development? || Rails.env.test?) && asset_paths.asset_for(javascript, "js").blank?
19
+ end
20
+ end
21
+ super
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ module Sprockets
2
+ module Helpers
3
+ module Nonexistent
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'sprockets/helpers/nonexistent'
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Sprockets::Helpers::Nonexistent do
4
+ it 'has a version number' do
5
+ expect(Sprockets::Helpers::Nonexistent::VERSION).not_to be nil
6
+ end
7
+
8
+ it 'does something useful' do
9
+ expect(false).to eq(true)
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sprockets/helpers/nonexistent/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sprockets-helpers-nonexistent"
8
+ spec.version = Sprockets::Helpers::Nonexistent::VERSION
9
+ spec.authors = ["h3poteto"]
10
+ spec.email = ["h3.poteto@gmail.com"]
11
+ spec.summary = %q{raise error when assets cannot found through sprockets.}
12
+ spec.description = %q{raise error when assets cannot found through sprockets.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+
25
+ spec.add_dependency "actionpack", "~> 3.2"
26
+ spec.add_dependency "activesupport", "~> 3.2"
27
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sprockets-helpers-nonexistent
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - h3poteto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: actionpack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activesupport
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.2'
83
+ description: raise error when assets cannot found through sprockets.
84
+ email:
85
+ - h3.poteto@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
+ - Gemfile
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - lib/sprockets/helpers/nonexistent.rb
98
+ - lib/sprockets/helpers/nonexistent/version.rb
99
+ - spec/spec_helper.rb
100
+ - spec/sprockets/helpers/nonexistent_spec.rb
101
+ - sprockets-helpers-nonexistent.gemspec
102
+ homepage: ''
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
106
+ post_install_message:
107
+ rdoc_options: []
108
+ require_paths:
109
+ - lib
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ requirements: []
121
+ rubyforge_project:
122
+ rubygems_version: 2.2.2
123
+ signing_key:
124
+ specification_version: 4
125
+ summary: raise error when assets cannot found through sprockets.
126
+ test_files:
127
+ - spec/spec_helper.rb
128
+ - spec/sprockets/helpers/nonexistent_spec.rb