forked from kyleshevlin/shevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move files for shevy gem into this repo
- Loading branch information
1 parent
8bc49b8
commit 7531e44
Showing
9 changed files
with
153 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in shevy.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "bundler/gem_tasks" | ||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "bundler/setup" | ||
require "shevy" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require "irb" | ||
IRB.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "shevy/generator" | ||
|
||
shevy_path = File.expand_path('../../core', __FILE__) | ||
|
||
ENV["SASS_PATH"] = [ | ||
ENV["SASS_PATH"], | ||
shevy_path | ||
].compact.join(FILE::PATH_SEPARATOR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
require 'shevy/version' | ||
require 'fileutils' | ||
require 'thor' | ||
require 'pathname' | ||
|
||
module Shevy | ||
class Generator < Thor | ||
map ["-v", "--version"] => :version | ||
|
||
desc "install", "Install Shevy into your project" | ||
method_options :path => :string, :force => :boolean | ||
def install | ||
if shevy_files_already_exist? && !options[:force] | ||
puts "Shevy files already installed, doing nothing." | ||
else | ||
install_files | ||
puts "Shevy files installed to #{install_path}/" | ||
end | ||
end | ||
|
||
desc "update", "Update Shevy" | ||
method_options :path => :string | ||
def update | ||
if shevy_files_already_exist? | ||
remove_shevy_directory | ||
install_files | ||
puts "Shevy files updated." | ||
else | ||
puts "No existing shevy installation. Doing nothing." | ||
end | ||
end | ||
|
||
desc "version", "Show Shevy version" | ||
def version | ||
say "Shevy #{Shevy::VERSION}" | ||
end | ||
|
||
private | ||
|
||
def shevy_files_already_exist? | ||
install_path.exist? | ||
end | ||
|
||
def install_path | ||
@install_path ||= if options[:path] | ||
Pathname.new(File.join(options[:path], "shevy")) | ||
else | ||
Pathname.new("shevy") | ||
end | ||
end | ||
|
||
def install_files | ||
make_install_directory | ||
copy_in_scss_files | ||
end | ||
|
||
def remove_shevy_directory | ||
FileUtils.rm_rf("shevy") | ||
end | ||
|
||
def make_install_directory | ||
FileUtils.mkdir_p(install_path) | ||
end | ||
|
||
def copy_in_scss_files | ||
FileUtils.cp_r(all_stylesheets, install_path) | ||
end | ||
|
||
def all_stylesheets | ||
Dir["#{stylesheets_directory}/*"] | ||
end | ||
|
||
def stylesheets_directory | ||
File.join(top_level_directory, "core") | ||
end | ||
|
||
def top_level_directory | ||
File.dirname(File.dirname(File.dirname(__FILE__))) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Shevy | ||
VERSION = "2.0.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'shevy/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "shevy" | ||
spec.version = Shevy::VERSION | ||
spec.authors = ["Kyle Shevlin"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = %q{Sass library for typography and perfect vertical rhythm.} | ||
spec.description = %q{Shevy is a small Sass library for simple, configurable typography with perfect vertical rhythm.} | ||
spec.homepage = "https://github.com/kyleshevlin/shevy" | ||
spec.licenses = ['MIT'] | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_development_dependency "bundler", "~> 1.11" | ||
spec.add_development_dependency "rake", "~> 10.0" | ||
end |