h2ocube_rails_assets 0.6.0 → 0.7.0

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: d9dbe1db95e345961a3cd7741b12cff509089cae
4
- data.tar.gz: e37195dc1b0028d04727460a5dab9ecad69692ca
3
+ metadata.gz: 64d270c1a5213f8bcd106557bb4b292abf4ec7b2
4
+ data.tar.gz: d1a813e63ee1ed4af1361a71823d185b261f5b8d
5
5
  SHA512:
6
- metadata.gz: 5355bab9f79bd4eb77e7b182d35ec1332b7629d762e56428f12f23eeae2666710791cef3c08195a6b3bba896b3f3b3fe3ed90fd46d705dad96e1bcbd700aa9bb
7
- data.tar.gz: 50e20d60b1767e2556fe562e4e1d48c5f03995c6b4f70d32e23885888c472db284b528d006fcfd07f1feed3a8aeaf01af02a3418ef75416d8dc4f8e4583fb312
6
+ metadata.gz: 51d79a7797c2314fda3b9c12fe3331a1e088ae8c9c90ef67d93c8dca78880ddd870ec4dcf64445ffe07078e310598bbf90f6d1b8b2e05c94ae4dad8b88f6bb38
7
+ data.tar.gz: 7d9d56bb07eab8c528f1e552ff8a4cc3d9ae97344463a9a68bcfa86e4ed707fba24032df6b7c0baf2ecdf168a903a06968cf20e8a5d58039a650fc6f18cb687a
data/README.md CHANGED
@@ -26,12 +26,15 @@ Or install it yourself as:
26
26
  * slim-rails https://github.com/slim-template/slim-rails
27
27
  * sass-rails https://github.com/rails/sass-rails
28
28
  * coffee-rails https://github.com/rails/coffee-rails
29
- * babel-transpiler https://github.com/babel/ruby-babel-transpiler
30
29
  * therubyracer https://github.com/cowboyd/therubyracer
31
30
  * turbolinks https://github.com/turbolinks/turbolinks
32
31
  * uglifier https://github.com/lautis/uglifier
33
32
  * jquery-rails https://github.com/rails/jquery-rails
34
33
 
34
+ ## Include helper
35
+
36
+ `assets_source(type)` type is `:css` or `:js`
37
+
35
38
  ## Other Useful Gems
36
39
 
37
40
  Font::Awesome::Sass https://github.com/FortAwesome/font-awesome-sass
@@ -4,19 +4,19 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'h2ocube_rails_assets'
7
- gem.version = '0.6.0'
7
+ gem.version = '0.7.0'
8
8
  gem.authors = ['Ben']
9
9
  gem.email = ['ben@h2ocube.com']
10
10
  gem.description = 'Just an assets collection'
11
11
  gem.summary = 'Just an assets collection'
12
12
  gem.homepage = 'https://github.com/h2ocube/h2ocube_rails_assets'
13
13
  gem.license = 'MIT'
14
- gem.required_ruby_version = '~> 2.3'
14
+ gem.required_ruby_version = '~> 2.4'
15
15
 
16
16
  gem.files = `git ls-files`.split($/)
17
17
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ['lib']
20
20
 
21
- %w(sass-rails slim-rails coffee-rails uglifier turbolinks jquery-rails babel-transpiler).each{ |g| gem.add_dependency g }
21
+ %w(sass-rails slim-rails coffee-rails uglifier turbolinks jquery-rails).each{ |g| gem.add_dependency g }
22
22
  end
@@ -1,7 +1,26 @@
1
1
  if defined?(Rails)
2
- %w(slim-rails sass-rails coffee-rails uglifier turbolinks jquery-rails babel-transpiler).each{ |g| require g }
2
+ %w(slim-rails sass-rails coffee-rails uglifier turbolinks jquery-rails).each{ |g| require g }
3
3
 
4
4
  module H2ocubeRailsAssets
5
+ module ActionView
6
+ module Helpers
7
+ def assets_source(type)
8
+ case type
9
+ when :css
10
+ list = []
11
+ list.push "#{request.subdomain.split('.')[0]}/#{params[:controller]}" if File.exist?(Rails.root.join("app/assets/stylesheets/#{request.subdomain.split('.')[0]}/#{params[:controller]}.sass"))
12
+ list.push "#{request.subdomain.split('.')[0]}/#{params[:controller]}/#{params[:action]}" if File.exist?(Rails.root.join("app/assets/stylesheets/#{request.subdomain.split('.')[0]}/#{params[:controller]}/#{params[:action]}.sass"))
13
+ list.empty? ? nil : stylesheet_link_tag(*list)
14
+ when :js
15
+ list = []
16
+ list.push "#{request.subdomain.split('.')[0]}/#{params[:controller]}" if File.exist?(Rails.root.join("app/assets/javascripts/#{request.subdomain.split('.')[0]}/#{params[:controller]}.js"))
17
+ list.push "#{request.subdomain.split('.')[0]}/#{params[:controller]}/#{params[:action]}" if File.exist?(Rails.root.join("app/assets/javascripts/#{request.subdomain.split('.')[0]}/#{params[:controller]}/#{params[:action]}.js"))
18
+ list.empty? ? nil : javascript_include_tag(*list)
19
+ end
20
+ end
21
+ end
22
+ end
23
+
5
24
  class Railtie < Rails::Railtie
6
25
  PATH = File.dirname(__FILE__)
7
26
  initializer 'h2ocube_rails_assets.require_dependency' do |app|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: h2ocube_rails_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-rails
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: babel-transpiler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  description: Just an assets collection
112
98
  email:
113
99
  - ben@h2ocube.com
@@ -135,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: '2.3'
124
+ version: '2.4'
139
125
  required_rubygems_version: !ruby/object:Gem::Requirement
140
126
  requirements:
141
127
  - - ">="
@@ -143,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
129
  version: '0'
144
130
  requirements: []
145
131
  rubyforge_project:
146
- rubygems_version: 2.6.4
132
+ rubygems_version: 2.6.8
147
133
  signing_key:
148
134
  specification_version: 4
149
135
  summary: Just an assets collection