genit 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +7 -0
- data/README.markdown +100 -0
- data/Rakefile +28 -0
- data/TODO +11 -0
- data/VERSION +1 -0
- data/bin/genit +53 -0
- data/data/pages/index.html +6 -0
- data/data/templates/main.html +12 -0
- data/lib/genit.rb +10 -0
- data/lib/genit/builder.rb +36 -0
- data/lib/genit/compiler.rb +50 -0
- data/lib/genit/html_document.rb +33 -0
- data/lib/genit/project_creator.rb +68 -0
- data/spec/bluecloth_spec.rb +12 -0
- data/spec/builder_spec.rb +17 -0
- data/spec/compiler_spec.rb +35 -0
- data/spec/helper.rb +19 -0
- data/spec/html_document_spec.rb +23 -0
- data/spec/nokogiri_spec.rb +26 -0
- data/spec/project_creator_spec.rb +90 -0
- data/spec/test-files/test.markdown +1 -0
- metadata +107 -0
data/NEWS
ADDED
data/README.markdown
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
Genit
|
2
|
+
================
|
3
|
+
|
4
|
+
Genit builds a **static web site**, that is a web site without server side programing language
|
5
|
+
and database. A site consists only of xhtml code (+ css and medias) and eventually of javascript.
|
6
|
+
|
7
|
+
The project is in early development stage, see
|
8
|
+
[project guidelines](https://github.com/lkdjiin/genit/blob/master/project_guidelines.markdown).
|
9
|
+
|
10
|
+
Description
|
11
|
+
-----------
|
12
|
+
|
13
|
+
It is a command line framework, essentially based on conventions.
|
14
|
+
|
15
|
+
Genit must above all be :
|
16
|
+
|
17
|
+
+ **simple**
|
18
|
+
+ **readable**
|
19
|
+
+ **minimalist**
|
20
|
+
|
21
|
+
Genit is based on the idea that *we don't have* to learn any new languages to manage templates
|
22
|
+
because **xml can do it well**.
|
23
|
+
|
24
|
+
For example, to generate the xhtml including the 4 latest news:
|
25
|
+
|
26
|
+
<generate class="news" number="4" />
|
27
|
+
|
28
|
+
And more simply, to generate the footer:
|
29
|
+
|
30
|
+
<generate class="footer" />
|
31
|
+
|
32
|
+
|
33
|
+
Install
|
34
|
+
-------------------------
|
35
|
+
|
36
|
+
First install ruby and rubygem (if there are not installed on your system) then:
|
37
|
+
|
38
|
+
gem install genit
|
39
|
+
|
40
|
+
|
41
|
+
Usage
|
42
|
+
--------------------------
|
43
|
+
|
44
|
+
genit create my-site
|
45
|
+
cd my-site
|
46
|
+
(*edit some pages*)
|
47
|
+
|
48
|
+
genit compile
|
49
|
+
|
50
|
+
Take a look at the [tutorial](https://github.com/lkdjiin/genit/blob/master/documentation/tutorial.markdown)
|
51
|
+
for more information.
|
52
|
+
|
53
|
+
|
54
|
+
Dependencies
|
55
|
+
--------------------------
|
56
|
+
|
57
|
+
* ruby >= 1.9.2
|
58
|
+
|
59
|
+
* nokogiri (xml parser)
|
60
|
+
* bluecloth (markdown parser)
|
61
|
+
|
62
|
+
### Contributors dependencies
|
63
|
+
|
64
|
+
* rspec for tests
|
65
|
+
* [coco](https://github.com/lkdjiin/coco) (code coverage must be 90% minimum)
|
66
|
+
* [tomdoc](http://tomdoc.org/) to document your code
|
67
|
+
|
68
|
+
|
69
|
+
License
|
70
|
+
--------------------------
|
71
|
+
|
72
|
+
Expat License (also known as MIT)
|
73
|
+
|
74
|
+
Copyright (c) 2011 Xavier Nayrac
|
75
|
+
|
76
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
77
|
+
a copy of this software and associated documentation files (the
|
78
|
+
"Software"), to deal in the Software without restriction, including
|
79
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
80
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
81
|
+
permit persons to whom the Software is furnished to do so, subject to
|
82
|
+
the following conditions:
|
83
|
+
|
84
|
+
The above copyright notice and this permission notice shall be included
|
85
|
+
in all copies or substantial portions of the Software.
|
86
|
+
|
87
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
88
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
89
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
90
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
91
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
92
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
93
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
94
|
+
|
95
|
+
|
96
|
+
Questions and/or Comments
|
97
|
+
--------------------------
|
98
|
+
|
99
|
+
Feel free to email [Xavier Nayrac](mailto:xavier.nayrac@gmail.com)
|
100
|
+
with any questions.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
|
6
|
+
desc 'Test genit'
|
7
|
+
task :default => :spec
|
8
|
+
|
9
|
+
desc 'Test genit with rspec'
|
10
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
11
|
+
t.rspec_opts = ['--color --format documentation']
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Check for code smells'
|
15
|
+
task :reek do
|
16
|
+
puts 'Checking for code smells...'
|
17
|
+
files = Dir.glob 'lib/**/*.rb'
|
18
|
+
# files.delete FILE_TO_EXCLUDE
|
19
|
+
args = files.join(' ')
|
20
|
+
sh "reek --quiet #{args} | ./reek.sed"
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Build genit & install it'
|
24
|
+
task :install do
|
25
|
+
sh "gem build genit.gemspec"
|
26
|
+
f = FileList['genit*gem'].to_a
|
27
|
+
sh "gem install #{f.first} --no-rdoc --no-ri"
|
28
|
+
end
|
data/TODO
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1
|
data/bin/genit
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- encoding: utf-8 -*-
|
3
|
+
|
4
|
+
#Copyright (c) 2011 Xavier Nayrac
|
5
|
+
#
|
6
|
+
#Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
#a copy of this software and associated documentation files (the
|
8
|
+
#"Software"), to deal in the Software without restriction, including
|
9
|
+
#without limitation the rights to use, copy, modify, merge, publish,
|
10
|
+
#distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
+
#permit persons to whom the Software is furnished to do so, subject to
|
12
|
+
#the following conditions:
|
13
|
+
#
|
14
|
+
#The above copyright notice and this permission notice shall be included
|
15
|
+
#in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
20
|
+
#IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
21
|
+
#CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
22
|
+
#TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
23
|
+
#SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
|
26
|
+
$GENIT_PATH = File.expand_path(File.dirname(__FILE__)) + '/..'
|
27
|
+
|
28
|
+
require 'genit'
|
29
|
+
include Genit
|
30
|
+
|
31
|
+
def usage
|
32
|
+
puts %q{usage: genit command
|
33
|
+
|
34
|
+
where command is:
|
35
|
+
create project-name
|
36
|
+
compile | cc}
|
37
|
+
end
|
38
|
+
|
39
|
+
case ARGV[0]
|
40
|
+
when "create"
|
41
|
+
case ARGV[1]
|
42
|
+
when /\w/
|
43
|
+
project = ProjectCreator.new ARGV[1]
|
44
|
+
project.create
|
45
|
+
else
|
46
|
+
usage
|
47
|
+
end
|
48
|
+
when "compile", "cc"
|
49
|
+
compiler = Compiler.new Dir.getwd
|
50
|
+
compiler.compile
|
51
|
+
else
|
52
|
+
usage
|
53
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
4
|
+
"DTD/xhtml1-strict.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<title>Genit - Static web site framework</title>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<genit class="pages" />
|
11
|
+
</body>
|
12
|
+
</html>
|
data/lib/genit.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'nokogiri'
|
4
|
+
|
5
|
+
module Genit
|
6
|
+
|
7
|
+
# Build a document from various sources.
|
8
|
+
class Builder
|
9
|
+
|
10
|
+
# Public: Constructor.
|
11
|
+
#
|
12
|
+
# document - A Nokogiri::HTML document
|
13
|
+
def initialize document
|
14
|
+
@document = document
|
15
|
+
end
|
16
|
+
|
17
|
+
# Public: Replace a tag (and its children) from the current document by a
|
18
|
+
# string.
|
19
|
+
#
|
20
|
+
# css_rule - The String css rule to find the tag
|
21
|
+
# replacement - The replacement String
|
22
|
+
#
|
23
|
+
# Examples
|
24
|
+
#
|
25
|
+
# doc = builder.replace('genit.pages', "<working />")
|
26
|
+
#
|
27
|
+
# Return the changed Nokogiri::HTML document.
|
28
|
+
def replace css_rule, replacement
|
29
|
+
tag = @document.at_css(css_rule)
|
30
|
+
tag.replace replacement
|
31
|
+
@document
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
module Genit
|
4
|
+
|
5
|
+
# Build the web site.
|
6
|
+
class Compiler
|
7
|
+
|
8
|
+
# Public: Constructor.
|
9
|
+
#
|
10
|
+
# working_dir - The String working directory, where live the project.
|
11
|
+
def initialize working_dir
|
12
|
+
@working_dir = working_dir
|
13
|
+
end
|
14
|
+
|
15
|
+
# Public: Build the web site.
|
16
|
+
def compile
|
17
|
+
Dir.foreach(File.join(@working_dir, 'pages')) do |file|
|
18
|
+
next if (file == ".") or (file == "..")
|
19
|
+
process file
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def process file
|
26
|
+
load_files file
|
27
|
+
build_file
|
28
|
+
write_file file
|
29
|
+
end
|
30
|
+
|
31
|
+
def load_files file
|
32
|
+
@template = HtmlDocument.open(File.join(@working_dir, 'templates/main.html'))
|
33
|
+
@page_content = HtmlDocument.open_as_string(File.join(@working_dir, 'pages', file))
|
34
|
+
end
|
35
|
+
|
36
|
+
def build_file
|
37
|
+
builder = Builder.new(@template)
|
38
|
+
@template = builder.replace('genit.pages', @page_content)
|
39
|
+
end
|
40
|
+
|
41
|
+
def write_file file
|
42
|
+
file.gsub! /\.markdown$/, '.html'
|
43
|
+
File.open(File.join(@working_dir, 'www', file), "w") do |out|
|
44
|
+
out.puts @template.to_html
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'nokogiri'
|
4
|
+
require 'bluecloth'
|
5
|
+
|
6
|
+
module Genit
|
7
|
+
|
8
|
+
# Open an html file in various format.
|
9
|
+
class HtmlDocument
|
10
|
+
|
11
|
+
# Public: Open a html document.
|
12
|
+
#
|
13
|
+
# file - Full path String filename
|
14
|
+
#
|
15
|
+
# Returns a Nokogiri::HTML document
|
16
|
+
def self.open file
|
17
|
+
Nokogiri::HTML(File.open(file))
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Open a html or markdown file as a string.
|
21
|
+
#
|
22
|
+
# file - Full path String name of a html or markdown file.
|
23
|
+
#
|
24
|
+
# Returns a String
|
25
|
+
def self.open_as_string file
|
26
|
+
string = IO.read file
|
27
|
+
string = BlueCloth.new(string).to_html if file.end_with? '.markdown'
|
28
|
+
string
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
module Genit
|
6
|
+
|
7
|
+
# Create a skeleton project.
|
8
|
+
class ProjectCreator
|
9
|
+
|
10
|
+
# Sole constructor.
|
11
|
+
#
|
12
|
+
# name - The String name of the future project folder.
|
13
|
+
def initialize name
|
14
|
+
@name = name
|
15
|
+
end
|
16
|
+
|
17
|
+
# Public: Create the structure of the project, that is many
|
18
|
+
# files and folders.
|
19
|
+
#
|
20
|
+
# Returns nothing.
|
21
|
+
def create
|
22
|
+
begin
|
23
|
+
FileUtils.makedirs @name
|
24
|
+
create_dirs ['news', 'pages', 'scripts', 'styles', 'templates', 'www']
|
25
|
+
create_dirs ['styles/css', 'styles/css/alsa', 'styles/css/yui', 'styles/images']
|
26
|
+
copy_files ['templates/main.html', 'pages/index.html']
|
27
|
+
rescue SystemCallError
|
28
|
+
puts "Cannot create project..."
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
# Create some subfolders inside the project folder.
|
35
|
+
#
|
36
|
+
# a_array - An Array of String subfolder names
|
37
|
+
#
|
38
|
+
# Examples
|
39
|
+
#
|
40
|
+
# create_dirs ['styles', 'scripts']
|
41
|
+
#
|
42
|
+
# create_dirs ['styles/css/alsa', 'styles/css/yui', 'styles/css/images']
|
43
|
+
#
|
44
|
+
# Returns nothing.
|
45
|
+
def create_dirs a_array
|
46
|
+
a_array.each {|dir| FileUtils.makedirs File.join(@name, dir) }
|
47
|
+
end
|
48
|
+
|
49
|
+
# Copy files to project.
|
50
|
+
#
|
51
|
+
# a_array - An Array of String "subfolder/file" names
|
52
|
+
#
|
53
|
+
# Example
|
54
|
+
#
|
55
|
+
# copy_files ['templates/main.html', 'pages/index.html']
|
56
|
+
#
|
57
|
+
# Returns nothing.
|
58
|
+
def copy_files a_array
|
59
|
+
a_array.each do |file|
|
60
|
+
src = File.join $GENIT_PATH, 'data', file
|
61
|
+
dest = File.join @name, file
|
62
|
+
FileUtils.cp src, dest
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require './spec/helper'
|
4
|
+
|
5
|
+
describe Builder do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@template = Nokogiri::HTML(File.open("data/templates/main.html"))
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should replace a css rule by a string" do
|
12
|
+
builder = Builder.new(@template)
|
13
|
+
doc = builder.replace('genit.pages', "<working />")
|
14
|
+
doc.css("body working").size.should == 1
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require './spec/helper'
|
4
|
+
|
5
|
+
describe Compiler do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@project = ProjectCreator.new('spec/project-name')
|
9
|
+
@project.create
|
10
|
+
@compiler = Compiler.new File.expand_path('spec/project-name')
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
clean_test_repository
|
15
|
+
end
|
16
|
+
|
17
|
+
def write_file name, content
|
18
|
+
File.open(File.join('spec/project-name', name), "w") do |file|
|
19
|
+
file.puts content
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should build an index.html page in www" do
|
24
|
+
@compiler.compile
|
25
|
+
File.exist?('spec/project-name/www/index.html').should == true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should build two pages" do
|
29
|
+
write_file 'pages/doc.html', '<h1>documentation</h1>'
|
30
|
+
@compiler.compile
|
31
|
+
File.exist?('spec/project-name/www/index.html').should == true
|
32
|
+
File.exist?('spec/project-name/www/doc.html').should == true
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/spec/helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'coco'
|
4
|
+
|
5
|
+
$GENIT_PATH = File.expand_path(File.join(File.expand_path(File.dirname(__FILE__)), '..'))
|
6
|
+
|
7
|
+
require './lib/genit'
|
8
|
+
include Genit
|
9
|
+
|
10
|
+
TEST_REPOSITORY = 'spec/project-name'
|
11
|
+
|
12
|
+
def clean_test_repository
|
13
|
+
Dir.foreach(TEST_REPOSITORY) do |file|
|
14
|
+
next if (file == ".") or (file == "..")
|
15
|
+
filename = File.join(TEST_REPOSITORY, file)
|
16
|
+
FileUtils.remove_dir(filename) if File.directory?(filename)
|
17
|
+
FileUtils.remove_file(filename) if File.file?(filename)
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require './spec/helper'
|
4
|
+
|
5
|
+
describe HtmlDocument do
|
6
|
+
|
7
|
+
it "should load as a document" do
|
8
|
+
doc = HtmlDocument.open("data/templates/main.html")
|
9
|
+
doc.css("body genit").size.should >= 1
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should load html as a string" do
|
13
|
+
content = HtmlDocument.open_as_string("data/pages/index.html")
|
14
|
+
content.class.should == String
|
15
|
+
content.size.should > 0
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should load markdown as a string" do
|
19
|
+
content = HtmlDocument.open_as_string("spec/test-files/test.markdown")
|
20
|
+
content.should == '<h1>title</h1>'
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require './spec/helper'
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
describe "Nokogiri library" do
|
7
|
+
|
8
|
+
before :all do
|
9
|
+
f = File.open("data/templates/main.html")
|
10
|
+
@doc = Nokogiri::HTML(f)
|
11
|
+
f.close
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should retrieve all genit tag" do
|
15
|
+
@doc.css("body genit").size.should == 1
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should retrieve a tag" do
|
19
|
+
@doc.at_css("body genit").to_s.should == '<genit class="pages"></genit>'
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should retrieve class of tag" do
|
23
|
+
@doc.at_css("body genit")['class'].should == "pages"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require './spec/helper'
|
4
|
+
|
5
|
+
describe ProjectCreator do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@project = ProjectCreator.new('spec/project-name')
|
9
|
+
@project.create
|
10
|
+
end
|
11
|
+
|
12
|
+
after :all do
|
13
|
+
clean_test_repository
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "Folder structure" do
|
17
|
+
|
18
|
+
it "should create a project folder" do
|
19
|
+
File.exist?('spec/project-name').should == true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should say it if it cannot create a project" do
|
23
|
+
project = ProjectCreator.new('/root/project')
|
24
|
+
$stdout.should_receive(:puts).with("Cannot create project...")
|
25
|
+
project.create
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should create a news folder" do
|
29
|
+
File.exist?('spec/project-name/news').should == true
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should create a pages folder" do
|
33
|
+
File.exist?('spec/project-name/pages').should == true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should create a scripts folder" do
|
37
|
+
File.exist?('spec/project-name/scripts').should == true
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should create a styles folder" do
|
41
|
+
File.exist?('spec/project-name/styles').should == true
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should create a templates folder" do
|
45
|
+
File.exist?('spec/project-name/templates').should == true
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should create a www folder" do
|
49
|
+
File.exist?('spec/project-name/www').should == true
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should create a css folder inside the styles" do
|
53
|
+
File.exist?('spec/project-name/styles/css').should == true
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should create a css/alsa folder inside the styles" do
|
57
|
+
File.exist?('spec/project-name/styles/css/alsa').should == true
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should create a css/yui folder inside the styles" do
|
61
|
+
File.exist?('spec/project-name/styles/css/yui').should == true
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should create a images folder inside the styles" do
|
65
|
+
File.exist?('spec/project-name/styles/images').should == true
|
66
|
+
end
|
67
|
+
|
68
|
+
end # "Folder structure"
|
69
|
+
|
70
|
+
describe "The files" do
|
71
|
+
|
72
|
+
it "should have got templates/main.html" do
|
73
|
+
File.exist?('data/templates/main.html').should be_true
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should copy templates/main.html" do
|
77
|
+
File.exist?('spec/project-name/templates/main.html').should be_true
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should have got pages/index.html" do
|
81
|
+
File.exist?('data/pages/index.html').should be_true
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should copy pages/index.html" do
|
85
|
+
File.exist?('spec/project-name/pages/index.html').should be_true
|
86
|
+
end
|
87
|
+
|
88
|
+
end # "The files"
|
89
|
+
|
90
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
#title
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: genit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Xavier Nayrac
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-06-25 00:00:00.000000000 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: coco
|
17
|
+
requirement: &82179570 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.4.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *82179570
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: nokogiri
|
28
|
+
requirement: &82179260 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.4.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *82179260
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bluecloth
|
39
|
+
requirement: &82178960 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.1.0
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *82178960
|
48
|
+
description: ! "Genit builds a **static web site**, that is a web site without server
|
49
|
+
side \nprograming language and database. The site consists only of xhtml code (+
|
50
|
+
css and medias) and \neventually of javascript. It is a command line framework,
|
51
|
+
essentially based on conventions.\nGenit is based on the idea that we don't have
|
52
|
+
to learn any new languages to manage templates\nbecause xml can do it well.\nGenit
|
53
|
+
is design to be simple, readable and minimalist."
|
54
|
+
email: xavier.nayrac@gmail.com
|
55
|
+
executables:
|
56
|
+
- genit
|
57
|
+
extensions: []
|
58
|
+
extra_rdoc_files: []
|
59
|
+
files:
|
60
|
+
- lib/genit/project_creator.rb
|
61
|
+
- lib/genit/html_document.rb
|
62
|
+
- lib/genit/builder.rb
|
63
|
+
- lib/genit/compiler.rb
|
64
|
+
- lib/genit.rb
|
65
|
+
- bin/genit
|
66
|
+
- data/templates/main.html
|
67
|
+
- data/pages/index.html
|
68
|
+
- spec/compiler_spec.rb
|
69
|
+
- spec/builder_spec.rb
|
70
|
+
- spec/helper.rb
|
71
|
+
- spec/html_document_spec.rb
|
72
|
+
- spec/nokogiri_spec.rb
|
73
|
+
- spec/project_creator_spec.rb
|
74
|
+
- spec/bluecloth_spec.rb
|
75
|
+
- spec/test-files/test.markdown
|
76
|
+
- VERSION
|
77
|
+
- NEWS
|
78
|
+
- README.markdown
|
79
|
+
- Rakefile
|
80
|
+
- TODO
|
81
|
+
has_rdoc: true
|
82
|
+
homepage: https://github.com/lkdjiin/genit
|
83
|
+
licenses:
|
84
|
+
- Expat (also known as MIT)
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 1.9.2
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 1.6.2
|
104
|
+
signing_key:
|
105
|
+
specification_version: 3
|
106
|
+
summary: Static web site framework
|
107
|
+
test_files: []
|