hootstrap 0.1.0 → 0.1.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: 68f9ce41ce6ecb4e1b67a98d418f7909b7c0e6f3
4
- data.tar.gz: b0037e82c01b3bad423990eab45e42642afeae13
3
+ metadata.gz: 4842f17730635a2426f9b0dcbb0717fc25c79f86
4
+ data.tar.gz: 4d5765d35877264586c6a4c198037565d8e96755
5
5
  SHA512:
6
- metadata.gz: '058a1167cef34215005f470bc553d3ca4f2301fe794760c39ab8cf6860b15c3ce0aca89a5ff96d315b3b47b7846e8d8f567cfe448c16da9330b6a39971b7b4db'
7
- data.tar.gz: c95a8538dc833fdad50c0a28baeefaf8866cbe3a21058cb61e8688b7c54f7d785262b90aaede969d95c78b006fe244a80fa416691ab5d99aba09d7cb3a33d716
6
+ metadata.gz: 423e4044b6742121d1d62a9878b97179b7e36f5bc035babe993d90c6bc9d4b41fee827eb080df5114a77036276e24b0b7503919deb25c7a7514b2fe0495e246a
7
+ data.tar.gz: bfe909fac5f9925179d309a3e9854afd5f1d68787b79368422db03058c91bc42cf140e78018f79d232a07ac5dfdd8d76f82e98f652ebb63ad5fcd199ad40bdb4
@@ -1,18 +1,58 @@
1
1
  require 'hootstrap/version'
2
- require 'hootstrap/railtie'
3
- require 'hootstrap/engine'
4
2
  require 'bootstrap'
5
- require 'sass'
6
3
 
7
4
  module Hootstrap
8
- def self.load
9
- asset_root = File.expand_path('../../assets', __FILE__)
10
- stylesheets_path = File.join(asset_root, 'stylesheets')
11
- javascripts_path = File.join(asset_root, 'javascripts')
12
-
13
- Sprockets.append_path(stylesheets_path)
14
- Sprockets.append_path(javascripts_path)
15
- Sass.load_paths << stylesheets_path
5
+ class << self
6
+ def load
7
+ if rails?
8
+ register_rails_engine
9
+ elsif sprockets?
10
+ register_sprockets
11
+ end
12
+
13
+ configure_sass
14
+ end
15
+
16
+ def rails?
17
+ defined?(::Rails)
18
+ end
19
+
20
+ def sprockets?
21
+ defined?(::Sprockets)
22
+ end
23
+
24
+ private
25
+
26
+ def register_rails_engine
27
+ require 'hootstrap/engine'
28
+ end
29
+
30
+ def register_sprockets
31
+ Sprockets.append_path(stylesheets_path)
32
+ Sprockets.append_path(javascripts_path)
33
+ end
34
+
35
+ def configure_sass
36
+ require 'sass'
37
+
38
+ ::Sass.load_paths << stylesheets_path
39
+ end
40
+
41
+ def stylesheets_path
42
+ File.join(assets_path, 'stylesheets')
43
+ end
44
+
45
+ def javascripts_path
46
+ File.join(assets_path, 'javascripts')
47
+ end
48
+
49
+ def assets_path
50
+ @assets_path ||= File.join(gem_path, 'assets')
51
+ end
52
+
53
+ def gem_path
54
+ @gem_path ||= File.expand_path('..', File.dirname(__FILE__))
55
+ end
16
56
  end
17
57
  end
18
58
 
@@ -1,8 +1,10 @@
1
1
  module Hootstrap
2
2
  module Rails
3
3
  class Engine < ::Rails::Engine
4
- initializer 'hootstrap.assets.precompile' do |app|
5
- app.config.assets.paths << root.join('app/assets/stylesheets').to_s
4
+ initializer 'hootstrap.assets' do |app|
5
+ %w(stylesheets javascripts).each do |sub|
6
+ app.config.assets.paths << root.join('assets', sub).to_s
7
+ end
6
8
  end
7
9
  end
8
10
  end
@@ -1,3 +1,3 @@
1
1
  module Hootstrap
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Licata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2017-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -112,7 +112,6 @@ files:
112
112
  - assets/stylesheets/hootstrap/utils/_typography.scss
113
113
  - lib/hootstrap.rb
114
114
  - lib/hootstrap/engine.rb
115
- - lib/hootstrap/railtie.rb
116
115
  - lib/hootstrap/version.rb
117
116
  homepage: https://github.com/ProctorU/hootstrap
118
117
  licenses:
@@ -134,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
133
  version: '0'
135
134
  requirements: []
136
135
  rubyforge_project:
137
- rubygems_version: 2.5.2
136
+ rubygems_version: 2.6.11
138
137
  signing_key:
139
138
  specification_version: 4
140
139
  summary: ProctorU's design system.
@@ -1,10 +0,0 @@
1
- module Hootstrap
2
- class Railtie < ::Rails::Railtie
3
- initializer 'hootstrap.asset_paths' do |app|
4
- %w(stylesheets).each do |sub|
5
- path = File.expand_path("../../../assets/#{sub}", __FILE__)
6
- app.config.assets.prepend_path(path)
7
- end
8
- end
9
- end
10
- end