diff --git a/Gemfile b/Gemfile index 2a35c7e..23a0d4e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in bootswatch-rails.gemspec +# Specify your gem's dependencies in bootswatch-sass.gemspec gemspec diff --git a/README.md b/README.md index 7c384c4..a74f105 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# bootswatch-rails +# bootswatch-sass [![Gem Version](https://badge.fury.io/rb/bootswatch-rails.svg)](http://badge.fury.io/rb/bootswatch-rails) @@ -12,7 +12,7 @@ bootstrap itself. Add this line to your application's Gemfile, in assets group: - gem 'bootswatch-rails' + gem 'bootswatch-sass' And then execute: diff --git a/bootswatch-rails.gemspec b/bootswatch-rails.gemspec deleted file mode 100644 index b2ff287..0000000 --- a/bootswatch-rails.gemspec +++ /dev/null @@ -1,18 +0,0 @@ -# -*- encoding: utf-8 -*- -require File.expand_path('../lib/bootswatch-rails/version', __FILE__) - -Gem::Specification.new do |gem| - gem.authors = ["Maxim Chernyak","Esteban Arango Medina"] - gem.email = ["max@bitsonnet.com","marranoparael31@gmail.com"] - gem.description = %q{Bootswatches converted to SCSS ready to use in Rails 3 asset pipeline.} - gem.summary = %q{Bootswatches in your Rails asset pipeline} - gem.homepage = "http://github.com/maxim/bootswatch-rails" - - gem.add_dependency 'railties', '>= 3.1' - - gem.files = `git ls-files`.split($\) - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - gem.name = "bootswatch-rails" - gem.require_paths = ["lib"] - gem.version = Bootswatch::Rails::VERSION -end diff --git a/bootswatch-sass.gemspec b/bootswatch-sass.gemspec new file mode 100644 index 0000000..a70a7c0 --- /dev/null +++ b/bootswatch-sass.gemspec @@ -0,0 +1,21 @@ +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'bootswatch-sass/version' + +Gem::Specification.new do |gem| + gem.name = "bootswatch-sass" + gem.version = Bootswatch::VERSION + gem.authors = ["Maxim Chernyak","Esteban Arango Medina"] + gem.email = ["max@bitsonnet.com","marranoparael31@gmail.com"] + gem.description = %q{Bootswatches converted to SCSS ready to use in Compass or Rails projects.} + gem.summary = %q{Bootswatches in Compass or Rails projects} + gem.homepage = "http://github.com/anthonycreates/bootswatch-sass" + + gem.add_dependency 'bootstrap-sass' + gem.add_dependency 'activesupport', '~> 3.2.0' + gem.add_dependency 'rake', '>= 0.8.7' + + gem.files = `git ls-files`.split($\) + gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.require_paths = ["lib"] +end diff --git a/lib/bootswatch-rails/version.rb b/lib/bootswatch-rails/version.rb deleted file mode 100644 index 268c156..0000000 --- a/lib/bootswatch-rails/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Bootswatch - module Rails - VERSION = '3.2.0' - end -end diff --git a/lib/bootswatch-sass.rb b/lib/bootswatch-sass.rb new file mode 100644 index 0000000..fdc6b29 --- /dev/null +++ b/lib/bootswatch-sass.rb @@ -0,0 +1,58 @@ +module Bootswatch + class << self + # Inspired by Bootstrap Sass + def load! + register_rails_engine if rails? + configure_sass + end + + # Paths + def gem_path + @gem_path ||= File.expand_path '..', File.dirname(__FILE__) + end + + def stylesheets_path + File.join assets_path, 'stylesheets' + end + + def fonts_path + File.join assets_path, 'fonts' + end + + def javascripts_path + File.join assets_path, 'javascripts' + end + + def assets_path + @assets_path ||= File.join gem_path, 'vendor', 'assets' + end + + # Environment detection helpers + def asset_pipeline? + defined?(::Sprockets) + end + + def compass? + defined?(::Compass) + end + + def rails? + defined?(::Rails) + end + + private + + def configure_sass + require 'sass' + + ::Sass.load_paths << stylesheets_path + end + + def register_rails_engine + require 'bootswatch-sass/engine' + end + end +end + +Bootswatch.load! + diff --git a/lib/bootswatch-rails.rb b/lib/bootswatch-sass/engine.rb similarity index 70% rename from lib/bootswatch-rails.rb rename to lib/bootswatch-sass/engine.rb index 5f16696..2bd037e 100644 --- a/lib/bootswatch-rails.rb +++ b/lib/bootswatch-sass/engine.rb @@ -1,5 +1,3 @@ -require 'bootswatch-rails/version' - module Bootswatch module Rails class Engine < ::Rails::Engine diff --git a/lib/bootswatch-sass/version.rb b/lib/bootswatch-sass/version.rb new file mode 100644 index 0000000..ad6bea7 --- /dev/null +++ b/lib/bootswatch-sass/version.rb @@ -0,0 +1,3 @@ +module Bootswatch + VERSION = '3.2.0.1' +end