grounds 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +22 -0
- data/Makefile +16 -0
- data/Rakefile +1 -0
- data/VERSION +1 -0
- data/bin/grounds +65 -0
- data/grounds.gemspec +15 -0
- data/lib/rack/grounds.rb +8 -0
- data/public/Makefile +4 -0
- data/public/index.css +0 -0
- data/public/index.html +12 -0
- data/public/index.html.grounds +4 -0
- data/public/index.js +0 -0
- data/ruby-bin/grounds +3 -0
- data/t/01-empty-input.bats +13 -0
- data/t/02-all-features.bats +30 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 518239f5829185ec886ed17a8eabf2355f752fa0
|
4
|
+
data.tar.gz: d257dee4c67cadf6ede99359c82673c8bc34f742
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e52b26e7b14e253a01acac9ef1ce14b57f6b4f1ec7a9cb7bc629f95d4d591f88ccff6ca7b74ee63db7ee3dde40d498e136ebb3291dc9d69f7c0dbb9f4f883a08
|
7
|
+
data.tar.gz: 9eeb8a070cbff001b9f1880d3ad018fbefae68172a74a730d8d9479b28918d8da4c5a65a6f74d8ea27a901cba2b362f4d236f8e5e1fb00295abadae72f60fbcc
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
grounds (0.0.1)
|
5
|
+
rack (~> 1.5.0)
|
6
|
+
rack-slashenforce (= 0.0.2)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
rack (1.5.2)
|
12
|
+
rack-slashenforce (0.0.2)
|
13
|
+
rack
|
14
|
+
rake (10.1.0)
|
15
|
+
|
16
|
+
PLATFORMS
|
17
|
+
ruby
|
18
|
+
|
19
|
+
DEPENDENCIES
|
20
|
+
bundler (~> 1.3)
|
21
|
+
grounds!
|
22
|
+
rake (~> 10.1)
|
data/Makefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
GEM = pkg/grounds-$(shell cat VERSION).gem
|
2
|
+
|
3
|
+
all: test html Gemfile.lock clean
|
4
|
+
|
5
|
+
test:
|
6
|
+
bats --tap t
|
7
|
+
html:
|
8
|
+
make -wC public
|
9
|
+
Gemfile.lock: Gemfile grounds.gemspec
|
10
|
+
bundle --no-color
|
11
|
+
$(GEM): Gemfile.lock lib/rack/grounds.rb
|
12
|
+
rake build
|
13
|
+
install: $(GEM)
|
14
|
+
rake install
|
15
|
+
clean:
|
16
|
+
git clean -Xdf
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/bin/grounds
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -o errexit
|
3
|
+
|
4
|
+
: ${language=en}
|
5
|
+
: ${charset=utf-8}
|
6
|
+
: ${viewport='width=device-width'}
|
7
|
+
|
8
|
+
--language() { language=$1; }
|
9
|
+
--attributes() { attributes+=" $1"; }
|
10
|
+
--charset() { charset=$1; }
|
11
|
+
--viewport() { viewport=$1; }
|
12
|
+
|
13
|
+
preamble=(language attributes charset viewport)
|
14
|
+
is-preamble-keyword()
|
15
|
+
{ printf '%s\n' ${preamble[*]} | grep "^$1\$" >/dev/null; }
|
16
|
+
maybe-insert-preamble()
|
17
|
+
if ! `is-preamble-keyword $1`; then
|
18
|
+
head+=("$(printf "$charset_tag" "$charset")")
|
19
|
+
head+=("$(printf "$viewport_tag" "$viewport")")
|
20
|
+
maybe-insert-preamble() { :; }
|
21
|
+
for x in ${preamble[*]}; do
|
22
|
+
eval 'function --'$x' { echo >&2 $0: '$x' must come first; }'
|
23
|
+
done; fi
|
24
|
+
|
25
|
+
: ${html_tag:='<html lang="%s"%s>'}
|
26
|
+
: ${charset_tag:='<meta charset="%s">'}
|
27
|
+
: ${viewport_tag:='<meta name="viewport" content="%s">'}
|
28
|
+
: ${title_tag:='<title>%s</title>'}
|
29
|
+
: ${javascript_tag:='<script src="%s"></script>'}
|
30
|
+
: ${stylesheet_tag:='<link rel="stylesheet" href="%s">'}
|
31
|
+
|
32
|
+
--head() { head+=("$1"); }
|
33
|
+
--body() { body+=("$1"); }
|
34
|
+
--foot() { foot+=("$1"); }
|
35
|
+
--title() { --head "$(printf "$title_tag" "$1")"; }
|
36
|
+
--stylesheet() { --head "$(printf "$stylesheet_tag" "$1")"; }
|
37
|
+
--javascript() { --foot "$(printf "$javascript_tag" "$1")"; }
|
38
|
+
--asset() case "$1" in
|
39
|
+
*.css) --stylesheet "$1";;
|
40
|
+
*.js) --javascript "$1";;
|
41
|
+
*) echo >&2 "$0: $1: ignoring unknown asset";; esac
|
42
|
+
|
43
|
+
while read keyword words; do
|
44
|
+
if [[ $keyword ]]; then
|
45
|
+
keyword=$(echo $keyword | tr A-Z a-z | sed 's/:$//')
|
46
|
+
[[ $words ]] || words=$keyword keyword=asset
|
47
|
+
if type >&/dev/null -- "--$keyword"; then
|
48
|
+
maybe-insert-preamble $keyword
|
49
|
+
--$keyword "${words[@]}"
|
50
|
+
elif [[ $keyword != '#' ]]; then
|
51
|
+
echo >&2 "$0: unknown keyword \`$keyword'"; fi
|
52
|
+
else
|
53
|
+
while read line; do --body "$line"; done; fi; done
|
54
|
+
|
55
|
+
maybe-insert-preamble
|
56
|
+
body=("${body[@]}" "${foot[@]}")
|
57
|
+
sed 's/^ *$//' <<EOF
|
58
|
+
<!doctype html>
|
59
|
+
`printf "$html_tag" "$language" "$attributes"`
|
60
|
+
<head>`[[ $head ]] && printf '\n %s' "${head[@]}"`
|
61
|
+
</head>
|
62
|
+
<body>`[[ $body ]] && printf '\n %s' "${body[@]}"`
|
63
|
+
</body>
|
64
|
+
</html>
|
65
|
+
EOF
|
data/grounds.gemspec
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |gem|
|
2
|
+
gem.name = 'grounds'
|
3
|
+
gem.version = `cat VERSION`
|
4
|
+
gem.summary = 'Grounds, HTML app toolkit'
|
5
|
+
gem.license = 'MIT'
|
6
|
+
gem.author = 'Daniel Brockman'
|
7
|
+
gem.email = 'daniel@brockman.se'
|
8
|
+
gem.files = `git ls-files`.split($/)
|
9
|
+
gem.bindir = 'ruby-bin'
|
10
|
+
gem.executables = 'grounds'
|
11
|
+
gem.add_dependency 'rack', '~> 1.5.0'
|
12
|
+
gem.add_dependency 'rack-slashenforce', '= 0.0.2'
|
13
|
+
gem.add_development_dependency 'bundler', '~> 1.3'
|
14
|
+
gem.add_development_dependency 'rake', '~> 10.1'
|
15
|
+
end
|
data/lib/rack/grounds.rb
ADDED
data/public/Makefile
ADDED
data/public/index.css
ADDED
File without changes
|
data/public/index.html
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width">
|
6
|
+
<link rel="stylesheet" href="index.css">
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<p>Grounds is the modern web developer’s best friend.</p>
|
10
|
+
<script src="index.js"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
data/public/index.js
ADDED
File without changes
|
data/ruby-bin/grounds
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- sh -*-
|
2
|
+
@test "all features" {
|
3
|
+
bin/grounds <<'^D' |
|
4
|
+
Language: sv
|
5
|
+
Attributes: ng-app="foo"
|
6
|
+
Charset: iso-8859-1
|
7
|
+
Viewport: initial-scale=1.0
|
8
|
+
Title: Example
|
9
|
+
foo.js
|
10
|
+
foo.css
|
11
|
+
|
12
|
+
<p>foo</p>
|
13
|
+
<p>bar</p>
|
14
|
+
^D
|
15
|
+
diff <<'^D' - <(cat); }
|
16
|
+
<!doctype html>
|
17
|
+
<html lang="sv" ng-app="foo">
|
18
|
+
<head>
|
19
|
+
<meta charset="iso-8859-1">
|
20
|
+
<meta name="viewport" content="initial-scale=1.0">
|
21
|
+
<title>Example</title>
|
22
|
+
<link rel="stylesheet" href="foo.css">
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
<p>foo</p>
|
26
|
+
<p>bar</p>
|
27
|
+
<script src="foo.js"></script>
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
^D
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: grounds
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Brockman
|
8
|
+
autorequire:
|
9
|
+
bindir: ruby-bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.5.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack-slashenforce
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.1'
|
69
|
+
description:
|
70
|
+
email: daniel@brockman.se
|
71
|
+
executables:
|
72
|
+
- grounds
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- Gemfile
|
78
|
+
- Gemfile.lock
|
79
|
+
- Makefile
|
80
|
+
- Rakefile
|
81
|
+
- VERSION
|
82
|
+
- bin/grounds
|
83
|
+
- grounds.gemspec
|
84
|
+
- lib/rack/grounds.rb
|
85
|
+
- public/Makefile
|
86
|
+
- public/index.css
|
87
|
+
- public/index.html
|
88
|
+
- public/index.html.grounds
|
89
|
+
- public/index.js
|
90
|
+
- ruby-bin/grounds
|
91
|
+
- t/01-empty-input.bats
|
92
|
+
- t/02-all-features.bats
|
93
|
+
homepage:
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.1.9
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Grounds, HTML app toolkit
|
117
|
+
test_files: []
|