Skip to content
This repository was archived by the owner on Jan 8, 2023. It is now read-only.

Commit f602453

Browse files
Load depending on environment, to work with Compass or Rails.
1 parent 85140ae commit f602453

File tree

8 files changed

+85
-28
lines changed

8 files changed

+85
-28
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
# Specify your gem's dependencies in bootswatch-rails.gemspec
3+
# Specify your gem's dependencies in bootswatch-sass.gemspec
44
gemspec

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# bootswatch-rails
1+
# bootswatch-sass
22

33
[![Gem Version](https://badge.fury.io/rb/bootswatch-rails.svg)](http://badge.fury.io/rb/bootswatch-rails)
44

@@ -12,7 +12,7 @@ bootstrap itself.
1212

1313
Add this line to your application's Gemfile, in assets group:
1414

15-
gem 'bootswatch-rails'
15+
gem 'bootswatch-sass'
1616

1717
And then execute:
1818

bootswatch-rails.gemspec

Lines changed: 0 additions & 18 deletions
This file was deleted.

bootswatch-sass.gemspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
lib = File.expand_path('../lib', __FILE__)
2+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3+
require 'bootswatch-sass/version'
4+
5+
Gem::Specification.new do |gem|
6+
gem.name = "bootswatch-sass"
7+
gem.version = Bootswatch::VERSION
8+
gem.authors = ["Maxim Chernyak","Esteban Arango Medina"]
9+
gem.email = ["max@bitsonnet.com","marranoparael31@gmail.com"]
10+
gem.description = %q{Bootswatches converted to SCSS ready to use in Compass or Rails projects.}
11+
gem.summary = %q{Bootswatches in Compass or Rails projects}
12+
gem.homepage = "http://github.com/anthonycreates/bootswatch-sass"
13+
14+
gem.add_dependency 'bootstrap-sass'
15+
gem.add_dependency 'activesupport', '~> 3.2.0'
16+
gem.add_dependency 'rake', '>= 0.8.7'
17+
18+
gem.files = `git ls-files`.split($\)
19+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20+
gem.require_paths = ["lib"]
21+
end

lib/bootswatch-rails/version.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/bootswatch-sass.rb

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module Bootswatch
2+
class << self
3+
# Inspired by Bootstrap Sass
4+
def load!
5+
register_rails_engine if rails?
6+
configure_sass
7+
end
8+
9+
# Paths
10+
def gem_path
11+
@gem_path ||= File.expand_path '..', File.dirname(__FILE__)
12+
end
13+
14+
def stylesheets_path
15+
File.join assets_path, 'stylesheets'
16+
end
17+
18+
def fonts_path
19+
File.join assets_path, 'fonts'
20+
end
21+
22+
def javascripts_path
23+
File.join assets_path, 'javascripts'
24+
end
25+
26+
def assets_path
27+
@assets_path ||= File.join gem_path, 'vendor', 'assets'
28+
end
29+
30+
# Environment detection helpers
31+
def asset_pipeline?
32+
defined?(::Sprockets)
33+
end
34+
35+
def compass?
36+
defined?(::Compass)
37+
end
38+
39+
def rails?
40+
defined?(::Rails)
41+
end
42+
43+
private
44+
45+
def configure_sass
46+
require 'sass'
47+
48+
::Sass.load_paths << stylesheets_path
49+
end
50+
51+
def register_rails_engine
52+
require 'bootswatch-sass/engine'
53+
end
54+
end
55+
end
56+
57+
Bootswatch.load!
58+

lib/bootswatch-rails.rb renamed to lib/bootswatch-sass/engine.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'bootswatch-rails/version'
2-
31
module Bootswatch
42
module Rails
53
class Engine < ::Rails::Engine

lib/bootswatch-sass/version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Bootswatch
2+
VERSION = '3.2.0.1'
3+
end

0 commit comments

Comments
 (0)