grund 0.1.pre → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +24 -0
- data/lib/grund.rb +1 -1
- data/lib/grund/generator.rb +78 -3
- metadata +6 -5
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Grund – a command line client for [Grund.css](https://github.com/johanbrook/grund.css)
|
2
|
+
|
3
|
+
This is a tiny Ruby gem for getting Grund.css into new projects.
|
4
|
+
|
5
|
+
gem install grund
|
6
|
+
grund install
|
7
|
+
|
8
|
+
Above will put the Grund.css files into the current directory. Type `grund help` for brief info.
|
9
|
+
|
10
|
+
See the repo for Grund.css for more info: [github.com/johanbrook/grund.css](https://github.com/johanbrook/grund.css)
|
11
|
+
|
12
|
+
# Contributions
|
13
|
+
|
14
|
+
Suggestions, pull requests and tips are welcomed.
|
15
|
+
|
16
|
+
# License (MIT)
|
17
|
+
|
18
|
+
Copyright © 2012 Johan Brook, http://johanbrook.com
|
19
|
+
|
20
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
21
|
+
|
22
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
23
|
+
|
24
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/grund.rb
CHANGED
data/lib/grund/generator.rb
CHANGED
@@ -1,12 +1,87 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
1
3
|
module Grund
|
2
4
|
class Generator
|
3
|
-
|
4
|
-
def initialize(args = nil)
|
5
5
|
|
6
|
+
PACKAGE_NAME = "grund.zip"
|
7
|
+
BUNDLE_NAME = "grund"
|
8
|
+
|
9
|
+
def initialize(args)
|
10
|
+
@url = 'https://github.com/johanbrook/grund.css/zipball/master'
|
11
|
+
@command = args.first
|
6
12
|
end
|
7
13
|
|
8
14
|
def run
|
9
|
-
|
15
|
+
if @command == "install"
|
16
|
+
get_zip @url
|
17
|
+
elsif @command == "-v" or @command == "--version"
|
18
|
+
puts "Grund #{Grund::VERSION}"
|
19
|
+
else
|
20
|
+
help
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def help
|
25
|
+
puts <<-h
|
26
|
+
|
27
|
+
GRUND. A SCSS foundation for Compass.
|
28
|
+
I use this as a starting point for new projects.
|
29
|
+
|
30
|
+
Usage:
|
31
|
+
|
32
|
+
\x1B[0;1m grund install \x1B[0m
|
33
|
+
|
34
|
+
Download the latest Grund files and put them in the current directory.
|
35
|
+
|
36
|
+
\x1B[0;1m compass compile \x1B[0m
|
37
|
+
|
38
|
+
Compiles the master file (master.scss) into CSS with Compass (http://compass-style.org).
|
39
|
+
|
40
|
+
Explore the file structure and make it your own. Pure SCSS stuff like
|
41
|
+
variables and mixins should be put in '_settings.scss' and 'lib/_mixins.scss'.
|
42
|
+
|
43
|
+
Main site styles go in '_main.scss' and in other imported files.
|
44
|
+
Includes Necolas' Normalize reset (https://github.com/necolas/normalize.css)
|
45
|
+
|
46
|
+
--
|
47
|
+
Project: https://github.com/johanbrook/grund
|
48
|
+
Author: Johan Brook (http://johanbrook.com)
|
49
|
+
h
|
50
|
+
end
|
51
|
+
|
52
|
+
def clean
|
53
|
+
system "rm -rf #{PACKAGE_NAME}"
|
54
|
+
system "rm -rf johanbrook-grund*"
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def status(msg)
|
60
|
+
puts "\x1B[0;1m#{msg}\x1B[0m"
|
61
|
+
end
|
62
|
+
|
63
|
+
def log(msg)
|
64
|
+
puts "\x1B[0;32m#{msg}\x1B[0m"
|
65
|
+
end
|
66
|
+
|
67
|
+
def directory_already_exist?
|
68
|
+
File.directory?(BUNDLE_NAME)
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_zip(url)
|
72
|
+
|
73
|
+
open(PACKAGE_NAME, 'wb') do |fo|
|
74
|
+
status "Downloading grund package from #{url}..."
|
75
|
+
fo.print open(url).read
|
76
|
+
status "Unpackaging ..."
|
77
|
+
system "unzip -o -q #{PACKAGE_NAME}"
|
78
|
+
|
79
|
+
system "cp -R johanbrook-grund*/ ."
|
80
|
+
log "Done!\n\x1B[0mBegin with checking out the stylesheet structure and set things up.\nType 'grund help' for more info.\n"
|
81
|
+
clean
|
82
|
+
end
|
83
|
+
|
10
84
|
end
|
85
|
+
|
11
86
|
end
|
12
87
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grund
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Johan Brook
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Grund ('foundation' in Swedish) generates a couple of SCSS files to start
|
15
15
|
off a new project with.
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- lib/grund.rb
|
23
23
|
- lib/grund/generator.rb
|
24
24
|
- bin/grund
|
25
|
+
- README.md
|
25
26
|
homepage: http://johanbrook.com
|
26
27
|
licenses:
|
27
28
|
- MIT
|
@@ -38,9 +39,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
|
-
- - ! '
|
42
|
+
- - ! '>='
|
42
43
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
+
version: '0'
|
44
45
|
requirements: []
|
45
46
|
rubyforge_project:
|
46
47
|
rubygems_version: 1.8.24
|