bitters 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +28 -0
- data/LICENSE.txt +22 -0
- data/README.md +70 -0
- data/Rakefile +1 -0
- data/app/assets/stylesheets/_base.scss +7 -0
- data/app/assets/stylesheets/_extends.scss +4 -0
- data/app/assets/stylesheets/_flashes.scss +50 -0
- data/app/assets/stylesheets/_forms.scss +85 -0
- data/app/assets/stylesheets/_grid-settings.scss +14 -0
- data/app/assets/stylesheets/_lists.scss +31 -0
- data/app/assets/stylesheets/_tables.scss +20 -0
- data/app/assets/stylesheets/_typography.scss +103 -0
- data/app/assets/stylesheets/_variables.scss +40 -0
- data/bin/bitters +5 -0
- data/bitters.gemspec +27 -0
- data/lib/bitters.rb +6 -0
- data/lib/bitters/generator.rb +74 -0
- data/lib/bitters/version.rb +3 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 57d20ec640123330b59b38d1a1ff1c1d7d9b14ad
|
4
|
+
data.tar.gz: a184926ad75a64dc340bca3579c6c6a8464a4c54
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b7f91dd91cf30c6e3c90c52ff45b24da35ea9ad4414aa39f3ec964808d3cc852c82ee156d9786c59e7c77efed81cb97d71be0421354652b92b19812bdea4c27f
|
7
|
+
data.tar.gz: ccb6932cec32fe04a9e6f3c92d2edfa6392c5e9c43c84caf04b43d270bb0818801b72f85c48da84bba6612088cf26d8c2e739291d87a8a1f89ab54457fa73ec2
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
bitters (0.0.2)
|
5
|
+
bourbon (>= 3.1)
|
6
|
+
neat (>= 1.4)
|
7
|
+
sass (>= 3.2)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
bourbon (3.1.8)
|
13
|
+
sass (>= 3.2.0)
|
14
|
+
thor
|
15
|
+
neat (1.4.0)
|
16
|
+
bourbon (>= 2.1)
|
17
|
+
sass (>= 3.2)
|
18
|
+
rake (10.1.0)
|
19
|
+
sass (3.2.10)
|
20
|
+
thor (0.18.1)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
bitters!
|
27
|
+
bundler (~> 1.3)
|
28
|
+
rake
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Reda Lemeden
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
Bitters
|
2
|
+
===
|
3
|
+
Add a dash of predefined style to get your [Bourbon](http://bourbon.io) stylesheets started off in the right direction.
|
4
|
+
|
5
|
+
Bitters is meant to help designers get projects started on new projects faster. It adds enough predefined structure and style to get started quickly but bland enough so that it doesn't dictate any style moving forward.
|
6
|
+
|
7
|
+
Install Instructions
|
8
|
+
===
|
9
|
+
Copy the Bitters base folder into your projects stylesheets and edit, delete or and refactor styles that don't fit your sites design. To include Bitters add `@include "base/base";` after a reset, we suggest [Normalize](http://necolas.github.io/normalize.css/), Bourbon and [Neat](http://neat.bourbon.io).
|
10
|
+
|
11
|
+
```scss
|
12
|
+
@import "normalize";
|
13
|
+
@import "bourbon";
|
14
|
+
@import "neat";
|
15
|
+
@import "base/base";
|
16
|
+
|
17
|
+
// All other imports
|
18
|
+
```
|
19
|
+
|
20
|
+
If you are using Neat overrides, `_grid-settings.scss` `@import "base/grid-settings"` between Bourbon and Neat as directed by [Neats Documentation](https://github.com/thoughtbot/neat#getting-started).
|
21
|
+
|
22
|
+
```scss
|
23
|
+
@import "normalize";
|
24
|
+
@import "bourbon";
|
25
|
+
@import "base/grid-settings";
|
26
|
+
@import "neat";
|
27
|
+
@import "base/base";
|
28
|
+
|
29
|
+
// All other imports
|
30
|
+
```
|
31
|
+
|
32
|
+
Getting Started
|
33
|
+
===
|
34
|
+
|
35
|
+
### Sass structure & default style
|
36
|
+
The base folder should contain styles for all the basic elements used throughout the sites style. Feel free to add any code that might be reused throughout the entire site. For example add an `_extends.scss` file or extends directory to contain your site wide extends.
|
37
|
+
|
38
|
+
The default style is meant to get out of the way and give you a good starting place for new projects. It shouldn't dictate any design decisions, only make the styles not look terrible from the start.
|
39
|
+
|
40
|
+
### Variables
|
41
|
+
This houses all variables that are used or will be used in more than one file. For variable names we try to use the most semantic name possible in our Scss. If using Neat overrides `@import` this file before Neat.
|
42
|
+
|
43
|
+
### Typography
|
44
|
+
All type is based on `$base-font-size` which is set to 1em (16px) by default. The spacing around type is based on `$base-line-height` so as to keep a semi-baseline grid. All sizes are scaled up or down by a factor of `.25`.
|
45
|
+
|
46
|
+
### Lists
|
47
|
+
All lists have stripped out styles. No bullets, no left padding. To add back the expected browser default styles add `@extend %default;` to the `<ul>` or `<ol>`.
|
48
|
+
|
49
|
+
### Forms
|
50
|
+
Adds basic styles all form elements. The variables at the top of the file all inherit from the variables file but make it really easy to be overridden.
|
51
|
+
|
52
|
+
### Flashes
|
53
|
+
Made for rails notices but can be used for any error, warning or success messages in applications or forms.
|
54
|
+
|
55
|
+
Requirements
|
56
|
+
===
|
57
|
+
- Sass 3.0+
|
58
|
+
- Bourbon 2.0+
|
59
|
+
|
60
|
+
Credits
|
61
|
+
===
|
62
|
+
|
63
|
+
![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
|
64
|
+
|
65
|
+
Bourbon is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community). Tweet your questions or suggestions at [@kylefiedler](https://twitter.com/kylefiedler).
|
66
|
+
|
67
|
+
License
|
68
|
+
===
|
69
|
+
|
70
|
+
Bitters is Copyright © 2013 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* Success, error & notice boxes for messages and errors. */
|
2
|
+
%flash {
|
3
|
+
margin-bottom: $base-line-height / 2;
|
4
|
+
padding: $base-line-height / 2;
|
5
|
+
font-weight: bold;
|
6
|
+
}
|
7
|
+
|
8
|
+
.error, #flash_failure {
|
9
|
+
@extend %flash;
|
10
|
+
background: $error-color;
|
11
|
+
color: darken($error-color, 60);
|
12
|
+
|
13
|
+
a {
|
14
|
+
color: darken($error-color, 70);
|
15
|
+
|
16
|
+
&:hover {
|
17
|
+
color: darken($error-color, 90);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.notice, #flash_notice {
|
23
|
+
@extend %flash;
|
24
|
+
background: $notice-color;
|
25
|
+
color: darken($notice-color, 60);
|
26
|
+
|
27
|
+
a {
|
28
|
+
color: darken($notice-color, 70);
|
29
|
+
|
30
|
+
&:hover {
|
31
|
+
color: darken($notice-color, 90);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
.success, #flash_success {
|
38
|
+
@extend %flash;
|
39
|
+
background: $success-color;
|
40
|
+
color: darken($success-color, 60);
|
41
|
+
|
42
|
+
a {
|
43
|
+
color: darken($success-color, 70);
|
44
|
+
|
45
|
+
&:hover {
|
46
|
+
color: darken($success-color, 90);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
@@ -0,0 +1,85 @@
|
|
1
|
+
$form-border-color: $base-border-color;
|
2
|
+
$form-border-color-hover: darken($base-border-color, 10);
|
3
|
+
$form-border-color-focus: $base-accent-color;
|
4
|
+
$form-border-radius: $base-accent-color;
|
5
|
+
$form-box-shadow: inset 0 1px 3px hsla(0, 0%, 0%, 0.06);
|
6
|
+
$form-box-shadow-focus: $form-box-shadow, 0 0 5px rgba(darken($form-border-color-focus, 5), 0.7);
|
7
|
+
$form-font-size: $base-font-size;
|
8
|
+
$form-font-family: $base-font-family;
|
9
|
+
|
10
|
+
fieldset {
|
11
|
+
background: lighten($base-border-color, 10);
|
12
|
+
border: 1px solid $base-border-color;
|
13
|
+
margin: 0 0 ($base-line-height / 2) 0;
|
14
|
+
padding: $base-line-height;
|
15
|
+
}
|
16
|
+
|
17
|
+
input,
|
18
|
+
label,
|
19
|
+
select {
|
20
|
+
display: block;
|
21
|
+
font-family: $form-font-family;
|
22
|
+
font-size: $form-font-size;
|
23
|
+
}
|
24
|
+
|
25
|
+
label {
|
26
|
+
font-weight: bold;
|
27
|
+
margin-bottom: $base-line-height / 4;
|
28
|
+
|
29
|
+
&.required:after {
|
30
|
+
content: "*";
|
31
|
+
}
|
32
|
+
|
33
|
+
abbr {
|
34
|
+
display: none;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
textarea,
|
39
|
+
#{$all-text-inputs} {
|
40
|
+
@include box-sizing(border-box);
|
41
|
+
@include transition(border-color);
|
42
|
+
background-color: white;
|
43
|
+
border-radius: $form-border-radius;
|
44
|
+
border: 1px solid $form-border-color;
|
45
|
+
box-shadow: $form-box-shadow;
|
46
|
+
font-family: $form-font-family;
|
47
|
+
font-size: $form-font-size;
|
48
|
+
margin-bottom: $base-line-height / 2;
|
49
|
+
padding: ($base-line-height / 3) ($base-line-height / 3);
|
50
|
+
width: 100%;
|
51
|
+
|
52
|
+
&:hover {
|
53
|
+
border-color: $form-border-color-hover;
|
54
|
+
}
|
55
|
+
|
56
|
+
&:focus {
|
57
|
+
border-color: $form-border-color-focus;
|
58
|
+
box-shadow: $form-box-shadow-focus;
|
59
|
+
outline: none;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
input[type="search"] {
|
64
|
+
@include appearance(none);
|
65
|
+
}
|
66
|
+
|
67
|
+
input[type="checkbox"], input[type="radio"] {
|
68
|
+
display: inline;
|
69
|
+
margin-right: $base-line-height / 4;
|
70
|
+
}
|
71
|
+
|
72
|
+
select {
|
73
|
+
width: auto;
|
74
|
+
margin-bottom: $base-line-height;
|
75
|
+
}
|
76
|
+
|
77
|
+
button,
|
78
|
+
input[type="submit"] {
|
79
|
+
@extend %button;
|
80
|
+
@include appearance(none);
|
81
|
+
cursor: pointer;
|
82
|
+
user-select: none;
|
83
|
+
vertical-align: middle;
|
84
|
+
white-space: nowrap;
|
85
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
@import "neat-helpers"; // or "neat/neat-helpers" when not in Rails
|
2
|
+
|
3
|
+
// Neat Overrides
|
4
|
+
///////////////////////////////////////////////////////////////////////////////
|
5
|
+
// $column: 90px;
|
6
|
+
// $gutter: 30px;
|
7
|
+
// $grid-columns: 12;
|
8
|
+
// $max-width: em(1088);
|
9
|
+
|
10
|
+
// Neat Breakpoints
|
11
|
+
///////////////////////////////////////////////////////////////////////////////
|
12
|
+
$small-screen: new-breakpoint(em(540) 2);
|
13
|
+
$medium-screen: new-breakpoint(em(760) 4);
|
14
|
+
$large-screen: new-breakpoint(em(920) 8);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
ul, ol {
|
2
|
+
margin: 0;
|
3
|
+
padding: 0;
|
4
|
+
list-style-type: none;
|
5
|
+
|
6
|
+
&%default-ul {
|
7
|
+
list-style-type: disc;
|
8
|
+
margin-bottom: $base-line-height / 2;
|
9
|
+
padding-left: $base-line-height;
|
10
|
+
}
|
11
|
+
|
12
|
+
&%default-ol {
|
13
|
+
list-style-type: decimal;
|
14
|
+
margin-bottom: $base-line-height / 2;
|
15
|
+
padding-left: $base-line-height;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
dl {
|
20
|
+
line-height: $base-line-height;
|
21
|
+
margin-bottom: $base-line-height / 2;
|
22
|
+
|
23
|
+
dt {
|
24
|
+
font-weight: bold;
|
25
|
+
margin-top: $base-line-height / 2;
|
26
|
+
}
|
27
|
+
|
28
|
+
dd {
|
29
|
+
margin: 0;
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
table {
|
2
|
+
margin: ($base-line-height / 2) 0;
|
3
|
+
width: 100%;
|
4
|
+
}
|
5
|
+
|
6
|
+
th {
|
7
|
+
border-bottom: 1px solid darken($base-border-color, 15%);
|
8
|
+
font-weight: bold;
|
9
|
+
padding: ($base-line-height / 2) 0;
|
10
|
+
text-align: left;
|
11
|
+
}
|
12
|
+
|
13
|
+
td {
|
14
|
+
border-bottom: 1px solid $base-border-color;
|
15
|
+
padding: ($base-line-height / 2) 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
tr, td, th {
|
19
|
+
vertical-align: middle;
|
20
|
+
}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
body {
|
2
|
+
color: $base-font-color;
|
3
|
+
font-family: $base-font-family;
|
4
|
+
font-size: $base-font-size;
|
5
|
+
-webkit-font-smoothing: antialiased;
|
6
|
+
line-height: $base-line-height;
|
7
|
+
}
|
8
|
+
|
9
|
+
h1, h2, h3, h4, h5, h6 {
|
10
|
+
text-rendering: optimizeLegibility; // Fix the character spacing for headings
|
11
|
+
margin: 0;
|
12
|
+
line-height: 1.25em;
|
13
|
+
}
|
14
|
+
|
15
|
+
h1 {
|
16
|
+
font-size: $base-font-size * 2.25; // 16 * 2.25 = 36px
|
17
|
+
}
|
18
|
+
|
19
|
+
h2 {
|
20
|
+
font-size: $base-font-size * 2; // 16 * 2 = 32px
|
21
|
+
}
|
22
|
+
|
23
|
+
h3 {
|
24
|
+
font-size: $base-font-size * 1.75; // 16 * 1.75 = 28px
|
25
|
+
}
|
26
|
+
|
27
|
+
h4 {
|
28
|
+
font-size: $base-font-size * 1.5; // 16 * 1.5 = 24px
|
29
|
+
}
|
30
|
+
|
31
|
+
h5 {
|
32
|
+
font-size: $base-font-size * 1.25; // 16 * 1.25 = 20px
|
33
|
+
}
|
34
|
+
|
35
|
+
h6 {
|
36
|
+
font-size: $base-font-size;
|
37
|
+
}
|
38
|
+
|
39
|
+
p {
|
40
|
+
margin: 0 0 ($base-line-height * .5);
|
41
|
+
}
|
42
|
+
|
43
|
+
a {
|
44
|
+
color: $base-link-color;
|
45
|
+
text-decoration: none;
|
46
|
+
@include transition(color 0.1s linear);
|
47
|
+
|
48
|
+
&:hover {
|
49
|
+
color: $hover-link-color;
|
50
|
+
}
|
51
|
+
|
52
|
+
&:active, &:focus {
|
53
|
+
color: $hover-link-color;
|
54
|
+
outline: none;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
hr {
|
59
|
+
border-bottom: 1px solid $base-border-color;
|
60
|
+
border-left: none;
|
61
|
+
border-right: none;
|
62
|
+
border-top: none;
|
63
|
+
margin: $base-line-height 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
img {
|
67
|
+
margin: 0;
|
68
|
+
max-width: 100%;
|
69
|
+
}
|
70
|
+
|
71
|
+
abbr, acronym {
|
72
|
+
border-bottom: 1px dotted $base-border-color;
|
73
|
+
cursor: help;
|
74
|
+
}
|
75
|
+
|
76
|
+
address {
|
77
|
+
display: block;
|
78
|
+
margin: 0 0 ($base-line-height / 2);
|
79
|
+
}
|
80
|
+
|
81
|
+
hgroup {
|
82
|
+
margin-bottom: $base-line-height / 2;
|
83
|
+
}
|
84
|
+
|
85
|
+
del {
|
86
|
+
color: lighten($base-font-color, 15);
|
87
|
+
}
|
88
|
+
|
89
|
+
blockquote {
|
90
|
+
border-left: 2px solid $base-border-color;
|
91
|
+
color: lighten($base-font-color, 15);
|
92
|
+
margin: $base-line-height 0;
|
93
|
+
padding-left: $base-line-height / 2;
|
94
|
+
}
|
95
|
+
|
96
|
+
cite {
|
97
|
+
color: lighten($base-font-color, 25);
|
98
|
+
font-style: italic;
|
99
|
+
|
100
|
+
&:before {
|
101
|
+
content: '\2014 \00A0';
|
102
|
+
}
|
103
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// Typography
|
2
|
+
///////////////////////////////////////////////////////////////////////////////
|
3
|
+
$sans-serif: $helvetica;
|
4
|
+
$serif: $georgia;
|
5
|
+
|
6
|
+
$base-font-family: $sans-serif;
|
7
|
+
$header-font-family: $base-font-family;
|
8
|
+
|
9
|
+
// Sizes
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
11
|
+
$base-font-size: 1em;
|
12
|
+
$base-line-height: $base-font-size * 1.5;
|
13
|
+
$base-border-radius: em(3);
|
14
|
+
|
15
|
+
// Colors
|
16
|
+
///////////////////////////////////////////////////////////////////////////////
|
17
|
+
|
18
|
+
$blue: #477DCA;
|
19
|
+
$dark-gray: #333;
|
20
|
+
$medium-gray: #999;
|
21
|
+
$light-gray: #DDD;
|
22
|
+
$light-red: #FBE3E4;
|
23
|
+
$light-yellow: #FFF6BF;
|
24
|
+
$light-green: #E6EFC2;
|
25
|
+
|
26
|
+
// Font Colors
|
27
|
+
$base-font-color: $dark-gray;
|
28
|
+
$base-accent-color: $blue;
|
29
|
+
|
30
|
+
// Text Link Colors
|
31
|
+
$base-link-color: $base-accent-color;
|
32
|
+
$hover-link-color: darken($base-accent-color, 15);
|
33
|
+
|
34
|
+
// Border color
|
35
|
+
$base-border-color: $light-gray;
|
36
|
+
|
37
|
+
// Flash Colors
|
38
|
+
$error-color: $light-red;
|
39
|
+
$notice-color: $light-yellow;
|
40
|
+
$success-color: $light-green;
|
data/bin/bitters
ADDED
data/bitters.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bitters/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "bitters"
|
8
|
+
spec.version = Bitters::VERSION
|
9
|
+
spec.authors = ["Kyle Fiedler", "Reda Lemeden"]
|
10
|
+
spec.email = ["support@thoughtbot.com"]
|
11
|
+
spec.description = "Base styles for Web design"
|
12
|
+
spec.summary = "Base styles for Web design"
|
13
|
+
spec.homepage = "http://github.com/kaishin/biters"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
|
24
|
+
spec.add_dependency 'sass', '>= 3.2'
|
25
|
+
spec.add_dependency 'bourbon', '>= 3.1'
|
26
|
+
spec.add_dependency 'neat', '>= 1.4'
|
27
|
+
end
|
data/lib/bitters.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
|
3
|
+
module Bitters
|
4
|
+
class Generator
|
5
|
+
def initialize(arguments)
|
6
|
+
@subcommand = arguments.first
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
if @subcommand == "install"
|
11
|
+
install
|
12
|
+
elsif @subcommand == "update"
|
13
|
+
update
|
14
|
+
elsif @subcommand == "remove"
|
15
|
+
remove
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def update
|
20
|
+
if bitters_files_already_exist?
|
21
|
+
remove_bitters_directory
|
22
|
+
install_files
|
23
|
+
puts "Bitters files updated."
|
24
|
+
else
|
25
|
+
puts "No existing Bitters installation. Doing nothing."
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def install
|
30
|
+
if bitters_files_already_exist?
|
31
|
+
puts "Bitters files already installed, doing nothing."
|
32
|
+
else
|
33
|
+
install_files
|
34
|
+
puts "Bitters files installed to /base"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def remove
|
39
|
+
if bitters_files_already_exist?
|
40
|
+
remove_bitters_directory
|
41
|
+
puts "Bitters was successfully removed."
|
42
|
+
else
|
43
|
+
puts "No existing Bitters installation. Doing nothing."
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def bitters_files_already_exist?
|
50
|
+
File.directory?("base")
|
51
|
+
end
|
52
|
+
|
53
|
+
def install_files
|
54
|
+
FileUtils.mkdir_p("base")
|
55
|
+
FileUtils.cp_r(all_stylesheets, "base/")
|
56
|
+
end
|
57
|
+
|
58
|
+
def remove_bitters_directory
|
59
|
+
FileUtils.rm_rf("base")
|
60
|
+
end
|
61
|
+
|
62
|
+
def all_stylesheets
|
63
|
+
Dir["#{stylesheets_directory}/*"]
|
64
|
+
end
|
65
|
+
|
66
|
+
def stylesheets_directory
|
67
|
+
File.join(top_level_directory, "app", "assets", "stylesheets")
|
68
|
+
end
|
69
|
+
|
70
|
+
def top_level_directory
|
71
|
+
File.dirname(File.dirname(File.dirname(__FILE__)))
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bitters
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kyle Fiedler
|
8
|
+
- Reda Lemeden
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.3'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.3'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: sass
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '3.2'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '3.2'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: bourbon
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3.1'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.1'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: neat
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.4'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.4'
|
84
|
+
description: Base styles for Web design
|
85
|
+
email:
|
86
|
+
- support@thoughtbot.com
|
87
|
+
executables:
|
88
|
+
- bitters
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- .gitignore
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- app/assets/stylesheets/_base.scss
|
99
|
+
- app/assets/stylesheets/_extends.scss
|
100
|
+
- app/assets/stylesheets/_flashes.scss
|
101
|
+
- app/assets/stylesheets/_forms.scss
|
102
|
+
- app/assets/stylesheets/_grid-settings.scss
|
103
|
+
- app/assets/stylesheets/_lists.scss
|
104
|
+
- app/assets/stylesheets/_tables.scss
|
105
|
+
- app/assets/stylesheets/_typography.scss
|
106
|
+
- app/assets/stylesheets/_variables.scss
|
107
|
+
- bin/bitters
|
108
|
+
- bitters.gemspec
|
109
|
+
- lib/bitters.rb
|
110
|
+
- lib/bitters/generator.rb
|
111
|
+
- lib/bitters/version.rb
|
112
|
+
homepage: http://github.com/kaishin/biters
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.0.3
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: Base styles for Web design
|
136
|
+
test_files: []
|