staticpress 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rbenv-version +1 -1
- data/features/happy_path.feature +118 -0
- data/features/step_definitions/staticpress_steps.rb +29 -0
- data/features/support/env.rb +3 -0
- data/lib/skeleton/config.yml +7 -0
- data/lib/staticpress/cli.rb +7 -0
- data/lib/staticpress/configuration.rb +1 -1
- data/lib/staticpress/content/base.rb +13 -3
- data/lib/staticpress/content/post.rb +8 -0
- data/lib/staticpress/helpers.rb +6 -0
- data/lib/staticpress/pusher.rb +23 -0
- data/lib/staticpress/server.rb +1 -1
- data/lib/staticpress/version.rb +1 -1
- data/lib/themes/basic/assets/scripts/application.js +2 -4
- data/lib/themes/basic/assets/styles/{all.sass → all.css.sass} +0 -0
- data/lib/themes/basic/layouts/default.haml +5 -1
- data/lib/themes/basic/layouts/post_index.haml +5 -1
- data/staticpress.gemspec +2 -0
- data/tests/lib/staticpress/content/base_test.rb +0 -3
- data/tests/lib/staticpress/content/page_test.rb +17 -1
- data/tests/lib/staticpress/content/post_test.rb +8 -0
- data/tests/lib/staticpress/helpers_test.rb +7 -0
- data/tests/lib/staticpress/pusher_test.rb +9 -0
- data/tests/lib/staticpress/route_test.rb +1 -1
- data/tests/lib/staticpress/server_test.rb +24 -0
- data/tests/lib/staticpress/site_test.rb +2 -1
- data/tests/lib/staticpress/theme_test.rb +2 -1
- data/tests/lib/staticpress/view_helpers_test.rb +2 -1
- data/tests/lib/staticpress_test.rb +0 -4
- data/tests/sample_sites/test_blog/Gemfile +1 -1
- data/tests/sample_sites/test_blog/content/_posts/2011-07-20-hello.markdown +1 -0
- data/tests/sample_sites/test_blog/themes/test_theme/layouts/default.haml +2 -1
- data/tests/sample_sites/test_blog/themes/test_theme/layouts/post_index.haml +2 -1
- data/tests/test_helper.rb +6 -2
- data.tar.gz.sig +0 -0
- metadata +48 -24
- metadata.gz.sig +0 -0
- data/.rvmrc +0 -1
- data/lib/themes/basic/layouts/index.haml +0 -0
- data/tests/lib/staticpress/cli_test.rb +0 -67
data/.gitignore
CHANGED
data/.rbenv-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.3-p0
|
@@ -0,0 +1,118 @@
|
|
1
|
+
Feature: The happy path
|
2
|
+
|
3
|
+
Scenario: Some basic commands
|
4
|
+
Given I run `staticpress`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the output should contain "Usage"
|
7
|
+
|
8
|
+
Given I run `staticpress help`
|
9
|
+
Then the exit status should be 0
|
10
|
+
And the output should contain "Usage"
|
11
|
+
|
12
|
+
Given I run `staticpress --help`
|
13
|
+
Then the exit status should be 0
|
14
|
+
And the output should contain "Usage"
|
15
|
+
|
16
|
+
Given I run `staticpress version`
|
17
|
+
Then the exit status should be 0
|
18
|
+
And the output should contain "Staticpress"
|
19
|
+
|
20
|
+
Given I run `staticpress --version`
|
21
|
+
Then the exit status should be 0
|
22
|
+
And the output should contain "Staticpress"
|
23
|
+
|
24
|
+
Scenario: Creating a new blog
|
25
|
+
When I run `staticpress new my_new_blog`
|
26
|
+
Then the following files should exist:
|
27
|
+
| my_new_blog/config.ru |
|
28
|
+
| my_new_blog/config.yml |
|
29
|
+
| my_new_blog/Gemfile |
|
30
|
+
| my_new_blog/README.markdown |
|
31
|
+
|
32
|
+
Scenario: Creating a new blog with a custum title
|
33
|
+
When I run `staticpress new my_new_blog 'This is my blog'`
|
34
|
+
Then the file "my_new_blog/config.yml" should contain exactly:
|
35
|
+
"""
|
36
|
+
---
|
37
|
+
:title: This is my blog
|
38
|
+
|
39
|
+
"""
|
40
|
+
|
41
|
+
Scenario: Creating a new blog post
|
42
|
+
Given a blog exists
|
43
|
+
When I run `staticpress create 'Hello World'`
|
44
|
+
Then a directory named "content/_posts" should exist
|
45
|
+
And a post named "hello-world" should exist
|
46
|
+
|
47
|
+
Scenario: Creating a static page
|
48
|
+
Given a blog exists
|
49
|
+
When I run `staticpress create_page about`
|
50
|
+
Then a directory named "content" should exist
|
51
|
+
And a file named "content/about.markdown" should exist
|
52
|
+
|
53
|
+
Scenario: Copying a built-in plugin
|
54
|
+
Given a blog exists
|
55
|
+
When I run `staticpress fork_plugin blockquote`
|
56
|
+
Then a directory named "plugins" should exist
|
57
|
+
And a file named "plugins/blockquote.rb" should exist
|
58
|
+
|
59
|
+
Scenario: Copying and renaming a built-in plugin
|
60
|
+
Given a blog exists
|
61
|
+
When I run `staticpress fork_plugin blockquote pullquote`
|
62
|
+
Then a directory named "plugins" should exist
|
63
|
+
And a file named "plugins/pullquote.rb" should exist
|
64
|
+
And a file named "plugins/blockquote.rb" should not exist
|
65
|
+
|
66
|
+
Scenario: Copying the default theme
|
67
|
+
Given a blog exists
|
68
|
+
When I run `staticpress fork_theme`
|
69
|
+
Then a directory named "themes" should exist
|
70
|
+
And a directory named "themes/basic" should exist
|
71
|
+
|
72
|
+
Scenario: Listing all routes
|
73
|
+
Given a blog with content exists
|
74
|
+
When I run `staticpress list route`
|
75
|
+
Then the output should contain "/"
|
76
|
+
And the output should contain "/about"
|
77
|
+
And the output should contain "/hello-goodbye"
|
78
|
+
|
79
|
+
Scenario: Building a site
|
80
|
+
Given a blog with content exists
|
81
|
+
Then a directory named "public" should not exist
|
82
|
+
When I run `staticpress build`
|
83
|
+
Then a directory named "public" should exist
|
84
|
+
And the following files should exist:
|
85
|
+
| public/index.html |
|
86
|
+
| public/about/index.html |
|
87
|
+
|
88
|
+
Scenario: Pushing a compiled site to a remote location
|
89
|
+
Given a blog with content exists
|
90
|
+
And the blog has been previously built
|
91
|
+
And I append to "config.yml" with:
|
92
|
+
"""
|
93
|
+
:deployment_strategies:
|
94
|
+
:custom: 'cp -R public ../deployed'
|
95
|
+
"""
|
96
|
+
When I run `staticpress push`
|
97
|
+
Then the following files should exist:
|
98
|
+
| ../deployed/index.html |
|
99
|
+
| ../deployed/about/index.html |
|
100
|
+
|
101
|
+
Scenario: Deploying site (build and push in one step)
|
102
|
+
Given a blog with content exists
|
103
|
+
And I append to "config.yml" with:
|
104
|
+
"""
|
105
|
+
:deployment_strategies:
|
106
|
+
:custom: 'cp -R public ../deployed'
|
107
|
+
"""
|
108
|
+
Then the following files should not exist:
|
109
|
+
| public/index.html |
|
110
|
+
| public/about/index.html |
|
111
|
+
| ../deployed/index.html |
|
112
|
+
| ../deployed/about/index.html |
|
113
|
+
When I run `staticpress deploy`
|
114
|
+
Then the following files should exist:
|
115
|
+
| public/index.html |
|
116
|
+
| public/about/index.html |
|
117
|
+
| ../deployed/index.html |
|
118
|
+
| ../deployed/about/index.html |
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'staticpress/cli'
|
2
|
+
|
3
|
+
|
4
|
+
Given /^a blog exists$/ do
|
5
|
+
Staticpress::CLI.new.new('tmp/aruba/temporary_blog', 'Transient Thoughts')
|
6
|
+
cd('temporary_blog')
|
7
|
+
end
|
8
|
+
|
9
|
+
Given /^a blog with content exists$/ do
|
10
|
+
step("a blog exists")
|
11
|
+
Staticpress::CLI.new.create_page('about')
|
12
|
+
Staticpress::CLI.new.create('hello-goodbye')
|
13
|
+
end
|
14
|
+
|
15
|
+
Given /^the blog has been previously built$/ do
|
16
|
+
Staticpress::CLI.new.build
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
Then /^a post named "([^"]*)" should exist$/ do |post_title|
|
21
|
+
now = Time.now.utc
|
22
|
+
filename = [
|
23
|
+
now.year,
|
24
|
+
('%02d' % now.month),
|
25
|
+
('%02d' % now.day),
|
26
|
+
"#{post_title}.markdown"
|
27
|
+
].join('-')
|
28
|
+
step("a file named \"content/_posts/#{filename}\" should exist")
|
29
|
+
end
|
data/lib/skeleton/config.yml
CHANGED
@@ -13,6 +13,9 @@
|
|
13
13
|
:posts_source_path: content/_posts
|
14
14
|
:plugins: []
|
15
15
|
:subscribe_rss: /atom.xml
|
16
|
+
:deployment_strategy: :custom
|
17
|
+
:deployment_strategies:
|
18
|
+
:custom: ''
|
16
19
|
:routes:
|
17
20
|
:index: '/(page/:number)?'
|
18
21
|
:category: '/category/:name(/page/:number)?'
|
@@ -20,6 +23,10 @@
|
|
20
23
|
:page: '/:slug'
|
21
24
|
:post: '/:year/:month/:day/:title'
|
22
25
|
:theme: '/assets/:theme/:asset_type/:slug'
|
26
|
+
:title_separators:
|
27
|
+
:phrase: ' -> '
|
28
|
+
:site: ' | '
|
29
|
+
:word: ' '
|
23
30
|
:template_engine_options:
|
24
31
|
:sass:
|
25
32
|
:line_comments: false
|
data/lib/staticpress/cli.rb
CHANGED
@@ -9,6 +9,7 @@ require 'staticpress'
|
|
9
9
|
require 'staticpress/error'
|
10
10
|
require 'staticpress/helpers'
|
11
11
|
require 'staticpress/plugin'
|
12
|
+
require 'staticpress/pusher'
|
12
13
|
require 'staticpress/site'
|
13
14
|
require 'staticpress/version'
|
14
15
|
|
@@ -19,6 +20,9 @@ module Staticpress
|
|
19
20
|
|
20
21
|
default_task :help
|
21
22
|
|
23
|
+
map '--help' => :help
|
24
|
+
map '--version' => :version
|
25
|
+
|
22
26
|
desc 'help [task]', 'Describe available tasks or one specific task'
|
23
27
|
def help(*args)
|
24
28
|
general_usage = <<-USAGE
|
@@ -41,6 +45,8 @@ not exist, and files will be overwritten if they do exist
|
|
41
45
|
FileUtils.mkdir_p Staticpress.blog_path
|
42
46
|
FileUtils.cp_r((Staticpress.root + 'skeleton').children, Staticpress.blog_path)
|
43
47
|
|
48
|
+
config = self.config.clone
|
49
|
+
|
44
50
|
config.title = if name.to_s.empty?
|
45
51
|
Staticpress.blog_path.basename.to_s.split('_').map(&:capitalize).join(' ')
|
46
52
|
else
|
@@ -108,6 +114,7 @@ customizations. If [theme-name] is blank, copies the currently configured theme
|
|
108
114
|
|
109
115
|
desc 'push', 'Push blog to configured server'
|
110
116
|
def push
|
117
|
+
Staticpress::Pusher.push
|
111
118
|
end
|
112
119
|
|
113
120
|
desc 'deploy', 'Build blog and push in one step'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'rack/mime'
|
2
3
|
require 'tilt'
|
3
4
|
require 'yaml'
|
4
5
|
|
@@ -34,6 +35,10 @@ module Staticpress::Content
|
|
34
35
|
@content = c.match(regex_frontmatter) ? c.match(regex) : c.match(regex_text)
|
35
36
|
end
|
36
37
|
|
38
|
+
def content_type
|
39
|
+
Rack::Mime.mime_type output_path.extname
|
40
|
+
end
|
41
|
+
|
37
42
|
def exist?
|
38
43
|
template_path.file?
|
39
44
|
end
|
@@ -105,13 +110,18 @@ module Staticpress::Content
|
|
105
110
|
self.class.theme
|
106
111
|
end
|
107
112
|
|
113
|
+
def full_title
|
114
|
+
[
|
115
|
+
title,
|
116
|
+
config.title
|
117
|
+
].join config.title_separators.site
|
118
|
+
end
|
119
|
+
|
108
120
|
def title
|
109
121
|
if meta.title
|
110
122
|
meta.title
|
111
123
|
else
|
112
|
-
route.url_path
|
113
|
-
word.capitalize
|
114
|
-
end.join ' '
|
124
|
+
titleize(route.url_path)
|
115
125
|
end
|
116
126
|
end
|
117
127
|
|
@@ -20,6 +20,14 @@ module Staticpress::Content
|
|
20
20
|
Time.utc date[:year], date[:month], date[:day]
|
21
21
|
end
|
22
22
|
|
23
|
+
def title
|
24
|
+
if meta.title
|
25
|
+
meta.title
|
26
|
+
else
|
27
|
+
titleize(route.params[:title])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
23
31
|
def self.all
|
24
32
|
if (posts_dir = Staticpress.blog_path + config.posts_source_path).directory?
|
25
33
|
posts_dir.children.map { |post| find_by_path post }
|
data/lib/staticpress/helpers.rb
CHANGED
@@ -53,5 +53,11 @@ module Staticpress
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
def titleize(url_path)
|
58
|
+
url_path.sub(/^\//, '').split(/\//).map do |phrase|
|
59
|
+
phrase.split(/-/).map(&:capitalize).join(config.title_separators.word)
|
60
|
+
end.join(config.title_separators.phrase)
|
61
|
+
end
|
56
62
|
end
|
57
63
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'staticpress'
|
2
|
+
require 'staticpress/error'
|
3
|
+
require 'staticpress/helpers'
|
4
|
+
|
5
|
+
module Staticpress
|
6
|
+
class Pusher
|
7
|
+
extend Staticpress::Helpers
|
8
|
+
include Staticpress::Helpers
|
9
|
+
|
10
|
+
def custom
|
11
|
+
system config.deployment_strategies.custom
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.push
|
15
|
+
pusher = new
|
16
|
+
|
17
|
+
raise Staticpress::Error, 'Nothing to deploy' unless (Staticpress.blog_path + config.destination_path).directory?
|
18
|
+
raise Staticpress::Error, 'Deployment strategy not found' unless pusher.respond_to? config.deployment_strategy
|
19
|
+
|
20
|
+
pusher.send config.deployment_strategy
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/staticpress/server.rb
CHANGED
@@ -12,7 +12,7 @@ module Staticpress
|
|
12
12
|
content = @site.find_content_by_url_path env['REQUEST_PATH']
|
13
13
|
|
14
14
|
if content
|
15
|
-
[ 200, { 'Content-Type' =>
|
15
|
+
[ 200, { 'Content-Type' => content.content_type }, [ content.render ] ]
|
16
16
|
else
|
17
17
|
[ 404, {}, [] ]
|
18
18
|
end
|
data/lib/staticpress/version.rb
CHANGED
File without changes
|
@@ -1,5 +1,9 @@
|
|
1
|
+
!!! 5
|
1
2
|
%html
|
2
3
|
%head
|
3
|
-
%title= page.
|
4
|
+
%title= page.full_title
|
5
|
+
%link{ :rel => :stylesheet, :href => '/assets/basic/styles/all.css', :type => 'text/css' }/
|
6
|
+
%script{ :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js' }
|
7
|
+
%script{ :src => '/assets/basic/scripts/application.js' }
|
4
8
|
%body
|
5
9
|
= yield
|
@@ -1,5 +1,9 @@
|
|
1
|
+
!!! 5
|
1
2
|
%html
|
2
3
|
%head
|
3
|
-
%title= page.
|
4
|
+
%title= page.full_title
|
5
|
+
%link{ :rel => :stylesheet, :href => '/assets/basic/styles/all.css', :type => 'text/css' }/
|
6
|
+
%script{ :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js' }
|
7
|
+
%script{ :src => '/assets/basic/scripts/application.js' }
|
4
8
|
%body
|
5
9
|
= yield
|
data/staticpress.gemspec
CHANGED
@@ -25,7 +25,9 @@ Staticpress is a blog-focused static site generator. It uses Tilt for rendering
|
|
25
25
|
'/home/thomas/Code/___/certificates/gem-public_cert.pem'
|
26
26
|
]
|
27
27
|
|
28
|
+
s.add_development_dependency 'aruba'
|
28
29
|
s.add_development_dependency 'compass'
|
30
|
+
s.add_development_dependency 'cucumber'
|
29
31
|
s.add_development_dependency 'haml'
|
30
32
|
s.add_development_dependency 'minitest'
|
31
33
|
s.add_development_dependency 'ruby-debug19'
|
@@ -44,6 +44,13 @@ class ContentPageTest < ContentBaseTest
|
|
44
44
|
assert_equal 8, Staticpress::Content::Page.all.count
|
45
45
|
end
|
46
46
|
|
47
|
+
def test_content_type
|
48
|
+
assert_equal 'text/html', @page.content_type
|
49
|
+
assert_equal 'text/css', @style2.content_type
|
50
|
+
assert_equal 'image/png', @static_bin.content_type
|
51
|
+
assert_equal 'text/plain', @static_txt.content_type
|
52
|
+
end
|
53
|
+
|
47
54
|
def test_exist?
|
48
55
|
assert @page.exist?, '@page does not exist'
|
49
56
|
assert @second_page.exist?, '@second_page does not exist'
|
@@ -86,9 +93,10 @@ class ContentPageTest < ContentBaseTest
|
|
86
93
|
|
87
94
|
def test_render
|
88
95
|
expected_page = <<-HTML
|
96
|
+
<!DOCTYPE html>
|
89
97
|
<html>
|
90
98
|
<head>
|
91
|
-
<title
|
99
|
+
<title>About | Test Blog</title>
|
92
100
|
</head>
|
93
101
|
<body>
|
94
102
|
<p>in page</p>
|
@@ -128,4 +136,12 @@ body{color:green}
|
|
128
136
|
@static_txt.save
|
129
137
|
assert_equal @static_txt.template_path.read, @static_txt.output_path.read
|
130
138
|
end
|
139
|
+
|
140
|
+
def test_full_title
|
141
|
+
assert_equal 'Foo -> Bar -> Baz | Test Blog', @nested.full_title
|
142
|
+
end
|
143
|
+
|
144
|
+
def test_title
|
145
|
+
assert_equal 'Foo -> Bar -> Baz', @nested.title
|
146
|
+
end
|
131
147
|
end
|
@@ -17,6 +17,9 @@ class ContentPostTest < ContentBaseTest
|
|
17
17
|
|
18
18
|
@another_post_route = Staticpress::Route.from_url_path '/2011/08/20/forever'
|
19
19
|
@another_post = Staticpress::Content::Post.new @another_post_route, @post_dir + '2011-08-20-forever.markdown'
|
20
|
+
|
21
|
+
@long_title_post_route = Staticpress::Route.from_url_path '/2011/08/06/blogging-with-staticpress'
|
22
|
+
@long_title_post = Staticpress::Content::Post.new @long_title_post_route, @post_dir + '2011-08-06-blogging-with-staticpress.markdown'
|
20
23
|
end
|
21
24
|
|
22
25
|
def test__equalsequals
|
@@ -78,4 +81,9 @@ class ContentPostTest < ContentBaseTest
|
|
78
81
|
def test_route
|
79
82
|
assert_equal '/2011/07/20/hello', @post.route.url_path
|
80
83
|
end
|
84
|
+
|
85
|
+
def test_title
|
86
|
+
assert_equal 'Hello, World', @post.title
|
87
|
+
assert_equal 'Blogging With Staticpress', @long_title_post.title
|
88
|
+
end
|
81
89
|
end
|
@@ -54,4 +54,11 @@ class HelpersTest < TestHelper
|
|
54
54
|
|
55
55
|
def test_spider_directory
|
56
56
|
end
|
57
|
+
|
58
|
+
def test_titleize
|
59
|
+
assert_equal '', titleize('')
|
60
|
+
assert_equal '', titleize('/')
|
61
|
+
assert_equal 'Foo -> Bar -> Baz', titleize('/foo/bar/baz')
|
62
|
+
assert_equal 'Blogging With Staticpress', titleize('blogging-with-staticpress')
|
63
|
+
end
|
57
64
|
end
|
@@ -4,7 +4,7 @@ require 'staticpress/route'
|
|
4
4
|
|
5
5
|
class RouteTest < TestHelper
|
6
6
|
def setup
|
7
|
-
|
7
|
+
super
|
8
8
|
|
9
9
|
@route_category_0 = Staticpress::Route.new :content_type => Staticpress::Content::Category, :name => 'programming', :number => nil
|
10
10
|
@route_category_1 = Staticpress::Route.new :content_type => Staticpress::Content::Category, :name => 'programming', :number => '1'
|
@@ -1,4 +1,28 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
2
|
|
3
|
+
require 'staticpress/server'
|
4
|
+
|
3
5
|
class ServerTest < TestHelper
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
@server = Staticpress::Server.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def env(path)
|
12
|
+
{
|
13
|
+
'REQUEST_PATH' => path
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_call_root
|
18
|
+
response = @server.call(env('/'))
|
19
|
+
assert_equal 200, response.first
|
20
|
+
assert_equal 'text/html', response[1]['Content-Type']
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_call_image
|
24
|
+
response = @server.call(env('/ruby.png'))
|
25
|
+
assert_equal 200, response.first
|
26
|
+
assert_equal 'image/png', response[1]['Content-Type']
|
27
|
+
end
|
4
28
|
end
|
@@ -7,7 +7,8 @@ class ViewHelpersTest < TestHelper
|
|
7
7
|
include Staticpress::Helpers
|
8
8
|
|
9
9
|
def setup
|
10
|
-
|
10
|
+
super
|
11
|
+
|
11
12
|
@post_route = Staticpress::Route.from_url_path '/2011/07/20/hello'
|
12
13
|
@post = Staticpress::Content::Post.new @post_route, Staticpress.blog_path + config.posts_source_path + '2011-07-20-hello.markdown'
|
13
14
|
@view_helpers = Staticpress::ViewHelpers.new @post
|
@@ -3,10 +3,6 @@ require_relative '../test_helper'
|
|
3
3
|
require 'pathname'
|
4
4
|
|
5
5
|
class StaticpressTest < TestHelper
|
6
|
-
def setup
|
7
|
-
Staticpress.blog_path = TEST_BLOG
|
8
|
-
end
|
9
|
-
|
10
6
|
def test_blog_path
|
11
7
|
assert_equal Pathname.new('tests/sample_sites/test_blog').expand_path, Staticpress.blog_path
|
12
8
|
end
|
data/tests/test_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
|
2
2
|
|
3
3
|
require 'compass'
|
4
4
|
require 'haml'
|
5
5
|
require 'minitest/autorun'
|
6
|
-
require 'ruby-debug'
|
6
|
+
#require 'ruby-debug' # http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
|
7
7
|
require 'sass'
|
8
8
|
|
9
9
|
require 'staticpress'
|
@@ -12,6 +12,10 @@ class TestHelper < MiniTest::Unit::TestCase
|
|
12
12
|
SAMPLE_SITES = (Staticpress.root + '..' + 'tests' + 'sample_sites').expand_path
|
13
13
|
TEST_BLOG = SAMPLE_SITES + 'test_blog'
|
14
14
|
|
15
|
+
def setup
|
16
|
+
Staticpress.blog_path = TEST_BLOG
|
17
|
+
end
|
18
|
+
|
15
19
|
def teardown
|
16
20
|
Staticpress.blog_path = '.'
|
17
21
|
test_blog_public = TEST_BLOG + 'public'
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staticpress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -50,11 +50,33 @@ cert_chain:
|
|
50
50
|
-----END CERTIFICATE-----
|
51
51
|
|
52
52
|
'
|
53
|
-
date: 2011-
|
53
|
+
date: 2011-11-12 00:00:00.000000000 Z
|
54
54
|
dependencies:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aruba
|
57
|
+
requirement: &18923280 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: *18923280
|
55
66
|
- !ruby/object:Gem::Dependency
|
56
67
|
name: compass
|
57
|
-
requirement: &
|
68
|
+
requirement: &18922300 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: *18922300
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: cucumber
|
79
|
+
requirement: &18920520 !ruby/object:Gem::Requirement
|
58
80
|
none: false
|
59
81
|
requirements:
|
60
82
|
- - ! '>='
|
@@ -62,10 +84,10 @@ dependencies:
|
|
62
84
|
version: '0'
|
63
85
|
type: :development
|
64
86
|
prerelease: false
|
65
|
-
version_requirements: *
|
87
|
+
version_requirements: *18920520
|
66
88
|
- !ruby/object:Gem::Dependency
|
67
89
|
name: haml
|
68
|
-
requirement: &
|
90
|
+
requirement: &18919060 !ruby/object:Gem::Requirement
|
69
91
|
none: false
|
70
92
|
requirements:
|
71
93
|
- - ! '>='
|
@@ -73,10 +95,10 @@ dependencies:
|
|
73
95
|
version: '0'
|
74
96
|
type: :development
|
75
97
|
prerelease: false
|
76
|
-
version_requirements: *
|
98
|
+
version_requirements: *18919060
|
77
99
|
- !ruby/object:Gem::Dependency
|
78
100
|
name: minitest
|
79
|
-
requirement: &
|
101
|
+
requirement: &18917720 !ruby/object:Gem::Requirement
|
80
102
|
none: false
|
81
103
|
requirements:
|
82
104
|
- - ! '>='
|
@@ -84,10 +106,10 @@ dependencies:
|
|
84
106
|
version: '0'
|
85
107
|
type: :development
|
86
108
|
prerelease: false
|
87
|
-
version_requirements: *
|
109
|
+
version_requirements: *18917720
|
88
110
|
- !ruby/object:Gem::Dependency
|
89
111
|
name: ruby-debug19
|
90
|
-
requirement: &
|
112
|
+
requirement: &18917020 !ruby/object:Gem::Requirement
|
91
113
|
none: false
|
92
114
|
requirements:
|
93
115
|
- - ! '>='
|
@@ -95,10 +117,10 @@ dependencies:
|
|
95
117
|
version: '0'
|
96
118
|
type: :development
|
97
119
|
prerelease: false
|
98
|
-
version_requirements: *
|
120
|
+
version_requirements: *18917020
|
99
121
|
- !ruby/object:Gem::Dependency
|
100
122
|
name: sass
|
101
|
-
requirement: &
|
123
|
+
requirement: &18915080 !ruby/object:Gem::Requirement
|
102
124
|
none: false
|
103
125
|
requirements:
|
104
126
|
- - ! '>='
|
@@ -106,10 +128,10 @@ dependencies:
|
|
106
128
|
version: '0'
|
107
129
|
type: :development
|
108
130
|
prerelease: false
|
109
|
-
version_requirements: *
|
131
|
+
version_requirements: *18915080
|
110
132
|
- !ruby/object:Gem::Dependency
|
111
133
|
name: bundler
|
112
|
-
requirement: &
|
134
|
+
requirement: &18914420 !ruby/object:Gem::Requirement
|
113
135
|
none: false
|
114
136
|
requirements:
|
115
137
|
- - ! '>='
|
@@ -117,10 +139,10 @@ dependencies:
|
|
117
139
|
version: '0'
|
118
140
|
type: :runtime
|
119
141
|
prerelease: false
|
120
|
-
version_requirements: *
|
142
|
+
version_requirements: *18914420
|
121
143
|
- !ruby/object:Gem::Dependency
|
122
144
|
name: rack
|
123
|
-
requirement: &
|
145
|
+
requirement: &18913380 !ruby/object:Gem::Requirement
|
124
146
|
none: false
|
125
147
|
requirements:
|
126
148
|
- - ! '>='
|
@@ -128,10 +150,10 @@ dependencies:
|
|
128
150
|
version: '0'
|
129
151
|
type: :runtime
|
130
152
|
prerelease: false
|
131
|
-
version_requirements: *
|
153
|
+
version_requirements: *18913380
|
132
154
|
- !ruby/object:Gem::Dependency
|
133
155
|
name: thor
|
134
|
-
requirement: &
|
156
|
+
requirement: &18912880 !ruby/object:Gem::Requirement
|
135
157
|
none: false
|
136
158
|
requirements:
|
137
159
|
- - ! '>='
|
@@ -139,10 +161,10 @@ dependencies:
|
|
139
161
|
version: '0'
|
140
162
|
type: :runtime
|
141
163
|
prerelease: false
|
142
|
-
version_requirements: *
|
164
|
+
version_requirements: *18912880
|
143
165
|
- !ruby/object:Gem::Dependency
|
144
166
|
name: tilt
|
145
|
-
requirement: &
|
167
|
+
requirement: &18912280 !ruby/object:Gem::Requirement
|
146
168
|
none: false
|
147
169
|
requirements:
|
148
170
|
- - ! '>='
|
@@ -150,7 +172,7 @@ dependencies:
|
|
150
172
|
version: '0'
|
151
173
|
type: :runtime
|
152
174
|
prerelease: false
|
153
|
-
version_requirements: *
|
175
|
+
version_requirements: *18912280
|
154
176
|
description: ! 'Staticpress is a blog-focused static site generator. It uses Tilt
|
155
177
|
for rendering nearly any template you can think of and come with a built-in Rack
|
156
178
|
server for easy development previews.
|
@@ -165,11 +187,13 @@ extra_rdoc_files: []
|
|
165
187
|
files:
|
166
188
|
- .gitignore
|
167
189
|
- .rbenv-version
|
168
|
-
- .rvmrc
|
169
190
|
- Gemfile
|
170
191
|
- README.markdown
|
171
192
|
- Rakefile
|
172
193
|
- bin/staticpress
|
194
|
+
- features/happy_path.feature
|
195
|
+
- features/step_definitions/staticpress_steps.rb
|
196
|
+
- features/support/env.rb
|
173
197
|
- lib/skeleton/Gemfile
|
174
198
|
- lib/skeleton/README.markdown
|
175
199
|
- lib/skeleton/config.ru
|
@@ -197,6 +221,7 @@ files:
|
|
197
221
|
- lib/staticpress/plugins/blockquote.rb
|
198
222
|
- lib/staticpress/plugins/gist.rb
|
199
223
|
- lib/staticpress/plugins/titlecase.rb
|
224
|
+
- lib/staticpress/pusher.rb
|
200
225
|
- lib/staticpress/route.rb
|
201
226
|
- lib/staticpress/server.rb
|
202
227
|
- lib/staticpress/site.rb
|
@@ -204,16 +229,14 @@ files:
|
|
204
229
|
- lib/staticpress/version.rb
|
205
230
|
- lib/staticpress/view_helpers.rb
|
206
231
|
- lib/themes/basic/assets/scripts/application.js
|
207
|
-
- lib/themes/basic/assets/styles/all.sass
|
232
|
+
- lib/themes/basic/assets/styles/all.css.sass
|
208
233
|
- lib/themes/basic/includes/list_posts.haml
|
209
234
|
- lib/themes/basic/layouts/archive.haml
|
210
235
|
- lib/themes/basic/layouts/atom.haml
|
211
236
|
- lib/themes/basic/layouts/default.haml
|
212
|
-
- lib/themes/basic/layouts/index.haml
|
213
237
|
- lib/themes/basic/layouts/post_index.haml
|
214
238
|
- lib/themes/basic/views/default.haml
|
215
239
|
- staticpress.gemspec
|
216
|
-
- tests/lib/staticpress/cli_test.rb
|
217
240
|
- tests/lib/staticpress/configuration_test.rb
|
218
241
|
- tests/lib/staticpress/content/base_test.rb
|
219
242
|
- tests/lib/staticpress/content/category_test.rb
|
@@ -226,6 +249,7 @@ files:
|
|
226
249
|
- tests/lib/staticpress/js_object_test.rb
|
227
250
|
- tests/lib/staticpress/metadata_test.rb
|
228
251
|
- tests/lib/staticpress/plugin_test.rb
|
252
|
+
- tests/lib/staticpress/pusher_test.rb
|
229
253
|
- tests/lib/staticpress/route_test.rb
|
230
254
|
- tests/lib/staticpress/server_test.rb
|
231
255
|
- tests/lib/staticpress/site_test.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm 1.9.2@development
|
File without changes
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require_relative '../../test_helper'
|
2
|
-
|
3
|
-
require 'fileutils'
|
4
|
-
require 'pathname'
|
5
|
-
|
6
|
-
require 'staticpress/cli'
|
7
|
-
require 'staticpress/helpers'
|
8
|
-
|
9
|
-
class CLITest < TestHelper
|
10
|
-
include Staticpress::Helpers
|
11
|
-
|
12
|
-
TEMP_BLOG = SAMPLE_SITES + 'temp_blog'
|
13
|
-
|
14
|
-
def setup
|
15
|
-
Staticpress.blog_path = TEMP_BLOG
|
16
|
-
@cli = Staticpress::CLI.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def teardown
|
20
|
-
FileUtils.rm_rf TEMP_BLOG if TEMP_BLOG.directory?
|
21
|
-
super
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_help
|
25
|
-
end
|
26
|
-
|
27
|
-
# FIXME breaks ContentThemeTest#test_template_engine_options
|
28
|
-
def _test_new
|
29
|
-
refute TEMP_BLOG.directory?
|
30
|
-
@cli.new TEMP_BLOG
|
31
|
-
assert_equal 4, TEMP_BLOG.children.count
|
32
|
-
assert_equal 'Temp Blog', config.title
|
33
|
-
end
|
34
|
-
|
35
|
-
# FIXME breaks ContentThemeTest#test_template_engine_options
|
36
|
-
def _test_new_with_custom_title
|
37
|
-
@cli.new TEMP_BLOG, 'This is my blog'
|
38
|
-
assert_equal 'This is my blog', config.title
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_create
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_create_page
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_fork_plugin
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_fork_theme
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_build
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_serve
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_push
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_deploy
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_version
|
66
|
-
end
|
67
|
-
end
|