keystone-sass 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +30 -0
- data/README.md +12 -0
- data/Rakefile +17 -0
- data/app/assets/stylesheets/_keystone.scss +4 -0
- data/app/assets/stylesheets/keystone/_css3.scss +6 -0
- data/app/assets/stylesheets/keystone/_scaffolding.scss +3 -0
- data/app/assets/stylesheets/keystone/_typography.scss +3 -0
- data/app/assets/stylesheets/keystone/_utilities.scss +3 -0
- data/app/assets/stylesheets/keystone/css3/_background-clip.scss +5 -0
- data/app/assets/stylesheets/keystone/css3/_border-radius.scss +5 -0
- data/app/assets/stylesheets/keystone/css3/_box-shadow.scss +5 -0
- data/app/assets/stylesheets/keystone/css3/_box-sizing.scss +5 -0
- data/app/assets/stylesheets/keystone/css3/_opacity.scss +6 -0
- data/app/assets/stylesheets/keystone/css3/_transition.scss +5 -0
- data/app/assets/stylesheets/keystone/scaffolding/_grid.scss +0 -0
- data/app/assets/stylesheets/keystone/scaffolding/_reset.scss +75 -0
- data/app/assets/stylesheets/keystone/scaffolding/_structure.scss +23 -0
- data/app/assets/stylesheets/keystone/typography/_links.scss +66 -0
- data/app/assets/stylesheets/keystone/typography/_lists.scss +38 -0
- data/app/assets/stylesheets/keystone/typography/_replacement.scss +12 -0
- data/app/assets/stylesheets/keystone/utilities/_alignment.scss +3 -0
- data/app/assets/stylesheets/keystone/utilities/_autoclear.scss +11 -0
- data/app/assets/stylesheets/keystone/utilities/_hoverbox.scss +32 -0
- data/bin/keystone +5 -0
- data/keystone-sass.gemspec +30 -0
- data/keystone.gemspec +30 -0
- data/lib/keystone.rb +7 -0
- data/lib/keystone/boot.rb +17 -0
- data/lib/keystone/cli.rb +27 -0
- data/lib/keystone/compiler.rb +60 -0
- data/lib/keystone/installer.rb +53 -0
- metadata +90 -0
data/Manifest
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
README.md
|
2
|
+
Rakefile
|
3
|
+
app/assets/stylesheets/_keystone.scss
|
4
|
+
app/assets/stylesheets/keystone/_css3.scss
|
5
|
+
app/assets/stylesheets/keystone/_scaffolding.scss
|
6
|
+
app/assets/stylesheets/keystone/_typography.scss
|
7
|
+
app/assets/stylesheets/keystone/_utilities.scss
|
8
|
+
app/assets/stylesheets/keystone/css3/_background-clip.scss
|
9
|
+
app/assets/stylesheets/keystone/css3/_border-radius.scss
|
10
|
+
app/assets/stylesheets/keystone/css3/_box-shadow.scss
|
11
|
+
app/assets/stylesheets/keystone/css3/_box-sizing.scss
|
12
|
+
app/assets/stylesheets/keystone/css3/_opacity.scss
|
13
|
+
app/assets/stylesheets/keystone/css3/_transition.scss
|
14
|
+
app/assets/stylesheets/keystone/scaffolding/_grid.scss
|
15
|
+
app/assets/stylesheets/keystone/scaffolding/_reset.scss
|
16
|
+
app/assets/stylesheets/keystone/scaffolding/_structure.scss
|
17
|
+
app/assets/stylesheets/keystone/typography/_links.scss
|
18
|
+
app/assets/stylesheets/keystone/typography/_lists.scss
|
19
|
+
app/assets/stylesheets/keystone/typography/_replacement.scss
|
20
|
+
app/assets/stylesheets/keystone/utilities/_alignment.scss
|
21
|
+
app/assets/stylesheets/keystone/utilities/_autoclear.scss
|
22
|
+
app/assets/stylesheets/keystone/utilities/_hoverbox.scss
|
23
|
+
bin/keystone
|
24
|
+
keystone.gemspec
|
25
|
+
lib/keystone.rb
|
26
|
+
lib/keystone/boot.rb
|
27
|
+
lib/keystone/cli.rb
|
28
|
+
lib/keystone/compiler.rb
|
29
|
+
lib/keystone/installer.rb
|
30
|
+
Manifest
|
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
___ ___ ___ ___ ___ ___
|
2
|
+
/__/| / /\ ___ / /\ ___ / /\ /__/\ / /\
|
3
|
+
| |:| / /:/_ /__/| / /:/_ / /\ / /::\ \ \:\ / /:/_
|
4
|
+
| |:| / /:/ /\ | |:| / /:/ /\ / /:/ / /:/\:\ \ \:\ / /:/ /\
|
5
|
+
__| |:| / /:/ /:/_ | |:| / /:/ /::\ / /:/ / /:/ \:\ _____\__\:\ / /:/ /:/_
|
6
|
+
/__/\_|:|____ /__/:/ /:/ /\ __|__|:| /__/:/ /:/\:\ / /::\ /__/:/ \__\:\ /__/::::::::\ /__/:/ /:/ /\
|
7
|
+
\ \:\/:::::/ \ \:\/:/ /:/ /__/::::\ \ \:\/:/~/:/ /__/:/\:\ \ \:\ / /:/ \ \:\~~\~~\/ \ \:\/:/ /:/
|
8
|
+
\ \::/~~~~ \ \::/ /:/ ~\~~\:\ \ \::/ /:/ \__\/ \:\ \ \:\ /:/ \ \:\ ~~~ \ \::/ /:/
|
9
|
+
\ \:\ \ \:\/:/ \ \:\ \__\/ /:/ \ \:\ \ \:\/:/ \ \:\ \ \:\/:/
|
10
|
+
\ \:\ \ \::/ \__\/ /__/:/ \__\/ \ \::/ \ \:\ \ \::/
|
11
|
+
\__\/ \__\/ \__\/ \__\/ \__\/ \__\/
|
12
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
$: << File.expand_path(File.dirname(__FILE__) + "/lib")
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'bundler'
|
6
|
+
require 'echoe'
|
7
|
+
require 'keystone'
|
8
|
+
|
9
|
+
Echoe.new('keystone-sass', Keystone::VERSION) do |p|
|
10
|
+
p.description = "A library of Sass mixins."
|
11
|
+
p.summary = "Keystone provides a simple library of commonly used design patterns in the form of Sass mixins."
|
12
|
+
p.url = "http://github.com/imulus/keystone"
|
13
|
+
p.author = "Imulus"
|
14
|
+
p.email = "developer@imulus.com"
|
15
|
+
p.ignore_pattern = ["tmp/*", "test/*"]
|
16
|
+
p.development_dependencies = []
|
17
|
+
end
|
File without changes
|
@@ -0,0 +1,75 @@
|
|
1
|
+
@mixin global-reset {
|
2
|
+
html, body, div, span, applet, object, iframe,
|
3
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
4
|
+
a, abbr, acronym, address, big, cite, code,
|
5
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
6
|
+
small, strike, strong, sub, sup, tt, var,
|
7
|
+
b, u, i, center,
|
8
|
+
dl, dt, dd, ol, ul, li,
|
9
|
+
fieldset, form, label, legend,
|
10
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
11
|
+
article, aside, canvas, details, embed,
|
12
|
+
figure, figcaption, footer, header, hgroup,
|
13
|
+
menu, nav, output, ruby, section, summary,
|
14
|
+
time, mark, audio, video {
|
15
|
+
margin: 0;
|
16
|
+
padding: 0;
|
17
|
+
border: 0;
|
18
|
+
font-size: 100%;
|
19
|
+
font: inherit;
|
20
|
+
vertical-align: baseline;
|
21
|
+
}
|
22
|
+
|
23
|
+
article, aside, details, figcaption, figure,
|
24
|
+
footer, header, hgroup, menu, nav, section {
|
25
|
+
display: block;
|
26
|
+
}
|
27
|
+
|
28
|
+
body {
|
29
|
+
line-height: 1;
|
30
|
+
}
|
31
|
+
|
32
|
+
ol, ul {
|
33
|
+
list-style: none;
|
34
|
+
}
|
35
|
+
|
36
|
+
blockquote, q {
|
37
|
+
quotes: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
blockquote:before, blockquote:after,
|
41
|
+
q:before, q:after {
|
42
|
+
content: "";
|
43
|
+
content: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
table {
|
47
|
+
border-collapse: collapse;
|
48
|
+
border-spacing: 0;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
@mixin imulus-reset {
|
53
|
+
input, select, textarea, button {
|
54
|
+
background: transparent;
|
55
|
+
margin: 0;
|
56
|
+
padding: 0;
|
57
|
+
border: 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
ins {
|
61
|
+
text-decoration: none;
|
62
|
+
}
|
63
|
+
|
64
|
+
del {
|
65
|
+
text-decoration: line-through;
|
66
|
+
}
|
67
|
+
|
68
|
+
strong {
|
69
|
+
font-weight: bold;
|
70
|
+
}
|
71
|
+
|
72
|
+
em {
|
73
|
+
font-style: italic;
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@mixin html($html-background: false) {
|
2
|
+
font: $font-size/normal $sans-serif;
|
3
|
+
color: $font-color;
|
4
|
+
@if $html-background {
|
5
|
+
background: $html-background;
|
6
|
+
}
|
7
|
+
overflow-y: scroll;
|
8
|
+
}
|
9
|
+
|
10
|
+
@mixin body($body-background: false) {
|
11
|
+
position: relative;
|
12
|
+
line-height: $baseline;
|
13
|
+
@if $body-background {
|
14
|
+
background: $body-background;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
@mixin container($width) {
|
19
|
+
position: relative;
|
20
|
+
width: $width;
|
21
|
+
margin: 0 auto;
|
22
|
+
@include autoclear;
|
23
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
@mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) {
|
2
|
+
color: $normal;
|
3
|
+
|
4
|
+
@if $visited {
|
5
|
+
&:visited {
|
6
|
+
color: $visited;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
@if $focus {
|
11
|
+
&:focus {
|
12
|
+
color: $focus;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
@if $hover {
|
17
|
+
&:hover {
|
18
|
+
color: $hover;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
@if $active {
|
23
|
+
&:active {
|
24
|
+
color: $active;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
@mixin link-underlines($normal, $hover: false, $active: false, $visited: false, $focus: false) {
|
30
|
+
text-decoration: $normal;
|
31
|
+
|
32
|
+
@if $visited {
|
33
|
+
&:visited {
|
34
|
+
text-decoration: $visited;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
@if $focus {
|
39
|
+
&:focus {
|
40
|
+
text-decoration: $focus;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
@if $hover {
|
45
|
+
&:hover {
|
46
|
+
text-decoration: $hover;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
@if $active {
|
51
|
+
&:active {
|
52
|
+
text-decoration: $active;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
@mixin unstyled-link {
|
58
|
+
color: inherit;
|
59
|
+
text-decoration: inherit;
|
60
|
+
cursor: inherit;
|
61
|
+
|
62
|
+
&:active,
|
63
|
+
&:focus {
|
64
|
+
outline: none;
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
@mixin no-bullets {
|
2
|
+
list-style: none;
|
3
|
+
margin-left: 0;
|
4
|
+
|
5
|
+
ul, ol {
|
6
|
+
list-style: none;
|
7
|
+
margin-left: 0;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@mixin inline-list {
|
12
|
+
@include no-bullets;
|
13
|
+
float: left;
|
14
|
+
|
15
|
+
li {
|
16
|
+
float: left;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
@mixin fancy-lists {
|
21
|
+
ul {
|
22
|
+
padding: 0 0 10px 15px;
|
23
|
+
|
24
|
+
li {
|
25
|
+
padding: 0 0 5px 15px;
|
26
|
+
background: url("/images/icons/bullet.png") left 5px no-repeat;
|
27
|
+
}
|
28
|
+
|
29
|
+
ul {
|
30
|
+
padding-bottom: 0;
|
31
|
+
padding-top: 5px;
|
32
|
+
|
33
|
+
li {
|
34
|
+
background-image: url("/images/icons/bullet-inner.png");
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@mixin hide-text {
|
2
|
+
text-indent: -9999px;
|
3
|
+
overflow: hidden;
|
4
|
+
text-align: left;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin image-replacement($image, $width, $height, $x: 0, $y: 0) {
|
8
|
+
@include hide-text;
|
9
|
+
background: url($image) $x $y no-repeat;
|
10
|
+
width: $width;
|
11
|
+
height: $height;
|
12
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
@mixin hoverbox {
|
2
|
+
a.hover-box img,
|
3
|
+
a.hover-box img.original {
|
4
|
+
float: left;
|
5
|
+
position: relative;
|
6
|
+
}
|
7
|
+
|
8
|
+
a.hover-box img.hover {
|
9
|
+
display: none;
|
10
|
+
}
|
11
|
+
|
12
|
+
a.hover-box {
|
13
|
+
position: relative;
|
14
|
+
float: left;
|
15
|
+
display: block;
|
16
|
+
}
|
17
|
+
|
18
|
+
a.hover-box:hover {
|
19
|
+
display: block;
|
20
|
+
font-size: 100%;
|
21
|
+
z-index: 1;
|
22
|
+
}
|
23
|
+
|
24
|
+
a.hover-box:hover img.hover {
|
25
|
+
display: block;
|
26
|
+
position: absolute;
|
27
|
+
float: left;
|
28
|
+
left: 0;
|
29
|
+
top: 0;
|
30
|
+
z-index: 10;
|
31
|
+
}
|
32
|
+
}
|
data/bin/keystone
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "keystone-sass"
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Imulus"]
|
9
|
+
s.date = "2012-03-08"
|
10
|
+
s.description = "A library of Sass mixins."
|
11
|
+
s.email = "developer@imulus.com"
|
12
|
+
s.executables = ["keystone"]
|
13
|
+
s.extra_rdoc_files = ["README.md", "bin/keystone", "lib/keystone.rb", "lib/keystone/boot.rb", "lib/keystone/cli.rb", "lib/keystone/compiler.rb", "lib/keystone/installer.rb"]
|
14
|
+
s.files = ["README.md", "Rakefile", "app/assets/stylesheets/_keystone.scss", "app/assets/stylesheets/keystone/_css3.scss", "app/assets/stylesheets/keystone/_scaffolding.scss", "app/assets/stylesheets/keystone/_typography.scss", "app/assets/stylesheets/keystone/_utilities.scss", "app/assets/stylesheets/keystone/css3/_background-clip.scss", "app/assets/stylesheets/keystone/css3/_border-radius.scss", "app/assets/stylesheets/keystone/css3/_box-shadow.scss", "app/assets/stylesheets/keystone/css3/_box-sizing.scss", "app/assets/stylesheets/keystone/css3/_opacity.scss", "app/assets/stylesheets/keystone/css3/_transition.scss", "app/assets/stylesheets/keystone/scaffolding/_grid.scss", "app/assets/stylesheets/keystone/scaffolding/_reset.scss", "app/assets/stylesheets/keystone/scaffolding/_structure.scss", "app/assets/stylesheets/keystone/typography/_links.scss", "app/assets/stylesheets/keystone/typography/_lists.scss", "app/assets/stylesheets/keystone/typography/_replacement.scss", "app/assets/stylesheets/keystone/utilities/_alignment.scss", "app/assets/stylesheets/keystone/utilities/_autoclear.scss", "app/assets/stylesheets/keystone/utilities/_hoverbox.scss", "bin/keystone", "keystone.gemspec", "lib/keystone.rb", "lib/keystone/boot.rb", "lib/keystone/cli.rb", "lib/keystone/compiler.rb", "lib/keystone/installer.rb", "Manifest", "keystone-sass.gemspec"]
|
15
|
+
s.homepage = "http://github.com/imulus/keystone"
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Keystone-sass", "--main", "README.md"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = "keystone-sass"
|
19
|
+
s.rubygems_version = "1.8.17"
|
20
|
+
s.summary = "Keystone provides a simple library of commonly used design patterns in the form of Sass mixins."
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/keystone.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "keystone"
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Imulus"]
|
9
|
+
s.date = "2012-03-08"
|
10
|
+
s.description = "A library of Sass mixins."
|
11
|
+
s.email = "developer@imulus.com"
|
12
|
+
s.executables = ["keystone"]
|
13
|
+
s.extra_rdoc_files = ["README.md", "bin/keystone", "lib/keystone.rb", "lib/keystone/boot.rb", "lib/keystone/cli.rb", "lib/keystone/compiler.rb", "lib/keystone/installer.rb"]
|
14
|
+
s.files = ["README.md", "Rakefile", "app/assets/stylesheets/_keystone.scss", "app/assets/stylesheets/keystone/_css3.scss", "app/assets/stylesheets/keystone/_scaffolding.scss", "app/assets/stylesheets/keystone/_typography.scss", "app/assets/stylesheets/keystone/_utilities.scss", "app/assets/stylesheets/keystone/css3/_background-clip.scss", "app/assets/stylesheets/keystone/css3/_border-radius.scss", "app/assets/stylesheets/keystone/css3/_box-shadow.scss", "app/assets/stylesheets/keystone/css3/_box-sizing.scss", "app/assets/stylesheets/keystone/css3/_opacity.scss", "app/assets/stylesheets/keystone/css3/_transition.scss", "app/assets/stylesheets/keystone/scaffolding/_grid.scss", "app/assets/stylesheets/keystone/scaffolding/_reset.scss", "app/assets/stylesheets/keystone/scaffolding/_structure.scss", "app/assets/stylesheets/keystone/typography/_links.scss", "app/assets/stylesheets/keystone/typography/_lists.scss", "app/assets/stylesheets/keystone/typography/_replacement.scss", "app/assets/stylesheets/keystone/utilities/_alignment.scss", "app/assets/stylesheets/keystone/utilities/_autoclear.scss", "app/assets/stylesheets/keystone/utilities/_hoverbox.scss", "bin/keystone", "lib/keystone.rb", "lib/keystone/boot.rb", "lib/keystone/cli.rb", "lib/keystone/compiler.rb", "lib/keystone/installer.rb", "Manifest", "keystone.gemspec"]
|
15
|
+
s.homepage = "http://github.com/imulus/keystone"
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Keystone", "--main", "README.md"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = "keystone"
|
19
|
+
s.rubygems_version = "1.8.10"
|
20
|
+
s.summary = "Keystone provides a simple library of commonly used design patterns in the form of Sass mixins."
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
data/lib/keystone.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Keystone
|
2
|
+
class Boot
|
3
|
+
def initialize(commands, options)
|
4
|
+
@commands = commands
|
5
|
+
@options = options
|
6
|
+
end
|
7
|
+
|
8
|
+
def run
|
9
|
+
case @commands[0]
|
10
|
+
when "install"
|
11
|
+
Keystone::Installer.new(@options).install
|
12
|
+
when "compile"
|
13
|
+
Keystone::Compiler.new.compile
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/keystone/cli.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'keystone'
|
2
|
+
require 'optparse'
|
3
|
+
|
4
|
+
options = {}
|
5
|
+
|
6
|
+
optparse = OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: keystone command [arguments]"
|
8
|
+
|
9
|
+
opts.on( '-h', '--help', 'Display this screen' ) do
|
10
|
+
puts opts
|
11
|
+
exit 0
|
12
|
+
end
|
13
|
+
|
14
|
+
opts.on( '-v', '--version', 'Display the program version' ) do
|
15
|
+
puts "keystone #{Keystone::VERSION}"
|
16
|
+
exit 0
|
17
|
+
end
|
18
|
+
|
19
|
+
options[:path] = nil
|
20
|
+
opts.on( '-p', '--path PATH', 'Specify a path' ) do |path|
|
21
|
+
options[:path] = path
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
optparse.parse!
|
26
|
+
|
27
|
+
Keystone::Boot.new(ARGV, options).run
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Keystone
|
2
|
+
class Compiler
|
3
|
+
def compile
|
4
|
+
sub_directories_of(keystone_directory).each do |directory|
|
5
|
+
create_manifest(directory, get_partials_from(directory))
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
# TODO - Add toggle to allow any directory to be compiled, i.e. keystone compile -p my_keystone_install
|
12
|
+
def top_level_directory
|
13
|
+
File.dirname(File.dirname(File.dirname(__FILE__)))
|
14
|
+
end
|
15
|
+
|
16
|
+
def stylesheets_directory
|
17
|
+
File.join(top_level_directory, "app", "assets", "stylesheets")
|
18
|
+
end
|
19
|
+
|
20
|
+
def keystone_directory
|
21
|
+
File.join(stylesheets_directory, "keystone")
|
22
|
+
end
|
23
|
+
|
24
|
+
def sub_directories_of parent_directory
|
25
|
+
Dir.entries(parent_directory).select do |entry|
|
26
|
+
File.directory? File.join(keystone_directory,entry) and !(entry == '.' || entry == '..')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_partials_from directory
|
31
|
+
# TODO - Confirm file is a partial by presence of an underscore
|
32
|
+
Dir.entries(File.join(keystone_directory,directory)).select do |entry|
|
33
|
+
File.file? File.join(keystone_directory,directory,entry) and File.extname(entry) == ".scss"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# TODO - Clean this up
|
38
|
+
def create_manifest directory, partials
|
39
|
+
File.open("#{keystone_directory}/_#{directory}.scss", 'w') do |output_file|
|
40
|
+
puts "\nCreating _#{directory}.scss"
|
41
|
+
partials.each do |partial|
|
42
|
+
puts "+ #{partial}"
|
43
|
+
partial = partial.sub('.scss', '').sub('_', '')
|
44
|
+
output_file.write("@import \"#{directory}/#{partial}\";\n")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
files = Dir.entries(keystone_directory).select { |entry| File.file? File.join(keystone_directory,entry) }
|
49
|
+
|
50
|
+
File.open("#{stylesheets_directory}/_keystone.scss", 'w') do |output_file|
|
51
|
+
files.each do |file|
|
52
|
+
if File.extname(file) == ".scss"
|
53
|
+
file = file.sub(/.scss/, '').sub(/_/, '')
|
54
|
+
output_file.write("@import \"keystone/#{file}\";\n")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Keystone
|
4
|
+
class Installer
|
5
|
+
def initialize(options)
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
|
9
|
+
def install
|
10
|
+
if keystone_exists?
|
11
|
+
puts "Error: Keystone already exists."
|
12
|
+
else
|
13
|
+
install_keystone
|
14
|
+
puts "Keystone successfully installed to #{target_folder}/keystone/"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def target_folder
|
21
|
+
@options[:path] or Dir.pwd
|
22
|
+
end
|
23
|
+
|
24
|
+
def keystone_exists?
|
25
|
+
File.directory?("#{target_folder}/keystone")
|
26
|
+
end
|
27
|
+
|
28
|
+
def install_keystone
|
29
|
+
create_directory
|
30
|
+
copy_all_files
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_directory
|
34
|
+
FileUtils.mkdir_p("#{target_folder}/keystone/")
|
35
|
+
end
|
36
|
+
|
37
|
+
def copy_all_files
|
38
|
+
FileUtils.cp_r(all_files, "#{target_folder}/keystone/")
|
39
|
+
end
|
40
|
+
|
41
|
+
def all_files
|
42
|
+
Dir["#{css_directory}/*"]
|
43
|
+
end
|
44
|
+
|
45
|
+
def css_directory
|
46
|
+
File.join(top_level_directory, "app", "assets", "stylesheets")
|
47
|
+
end
|
48
|
+
|
49
|
+
def top_level_directory
|
50
|
+
File.dirname(File.dirname(File.dirname(__FILE__)))
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: keystone-sass
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Imulus
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-08 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: A library of Sass mixins.
|
15
|
+
email: developer@imulus.com
|
16
|
+
executables:
|
17
|
+
- keystone
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files:
|
20
|
+
- README.md
|
21
|
+
- bin/keystone
|
22
|
+
- lib/keystone.rb
|
23
|
+
- lib/keystone/boot.rb
|
24
|
+
- lib/keystone/cli.rb
|
25
|
+
- lib/keystone/compiler.rb
|
26
|
+
- lib/keystone/installer.rb
|
27
|
+
files:
|
28
|
+
- README.md
|
29
|
+
- Rakefile
|
30
|
+
- app/assets/stylesheets/_keystone.scss
|
31
|
+
- app/assets/stylesheets/keystone/_css3.scss
|
32
|
+
- app/assets/stylesheets/keystone/_scaffolding.scss
|
33
|
+
- app/assets/stylesheets/keystone/_typography.scss
|
34
|
+
- app/assets/stylesheets/keystone/_utilities.scss
|
35
|
+
- app/assets/stylesheets/keystone/css3/_background-clip.scss
|
36
|
+
- app/assets/stylesheets/keystone/css3/_border-radius.scss
|
37
|
+
- app/assets/stylesheets/keystone/css3/_box-shadow.scss
|
38
|
+
- app/assets/stylesheets/keystone/css3/_box-sizing.scss
|
39
|
+
- app/assets/stylesheets/keystone/css3/_opacity.scss
|
40
|
+
- app/assets/stylesheets/keystone/css3/_transition.scss
|
41
|
+
- app/assets/stylesheets/keystone/scaffolding/_grid.scss
|
42
|
+
- app/assets/stylesheets/keystone/scaffolding/_reset.scss
|
43
|
+
- app/assets/stylesheets/keystone/scaffolding/_structure.scss
|
44
|
+
- app/assets/stylesheets/keystone/typography/_links.scss
|
45
|
+
- app/assets/stylesheets/keystone/typography/_lists.scss
|
46
|
+
- app/assets/stylesheets/keystone/typography/_replacement.scss
|
47
|
+
- app/assets/stylesheets/keystone/utilities/_alignment.scss
|
48
|
+
- app/assets/stylesheets/keystone/utilities/_autoclear.scss
|
49
|
+
- app/assets/stylesheets/keystone/utilities/_hoverbox.scss
|
50
|
+
- bin/keystone
|
51
|
+
- keystone.gemspec
|
52
|
+
- lib/keystone.rb
|
53
|
+
- lib/keystone/boot.rb
|
54
|
+
- lib/keystone/cli.rb
|
55
|
+
- lib/keystone/compiler.rb
|
56
|
+
- lib/keystone/installer.rb
|
57
|
+
- Manifest
|
58
|
+
- keystone-sass.gemspec
|
59
|
+
homepage: http://github.com/imulus/keystone
|
60
|
+
licenses: []
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options:
|
63
|
+
- --line-numbers
|
64
|
+
- --inline-source
|
65
|
+
- --title
|
66
|
+
- Keystone-sass
|
67
|
+
- --main
|
68
|
+
- README.md
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.2'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project: keystone-sass
|
85
|
+
rubygems_version: 1.8.17
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: Keystone provides a simple library of commonly used design patterns in the
|
89
|
+
form of Sass mixins.
|
90
|
+
test_files: []
|