staticpress 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/lib/skeleton/config.yml +1 -1
  2. data/lib/staticpress/configuration.rb +1 -0
  3. data/lib/staticpress/theme.rb +5 -1
  4. data/lib/staticpress/version.rb +1 -1
  5. data/lib/themes/{classic → basic}/assets/scripts/application.js +0 -0
  6. data/lib/themes/{classic → basic}/assets/styles/all.sass +0 -0
  7. data/lib/themes/{classic → basic}/includes/list_posts.haml +0 -0
  8. data/lib/themes/{classic → basic}/layouts/archive.haml +0 -0
  9. data/lib/themes/{classic → basic}/layouts/atom.haml +0 -0
  10. data/lib/themes/{classic → basic}/layouts/default.haml +0 -0
  11. data/lib/themes/{classic → basic}/layouts/index.haml +0 -0
  12. data/lib/themes/{classic → basic}/layouts/post_index.haml +0 -0
  13. data/lib/themes/{classic → basic}/views/default.haml +0 -0
  14. data/staticpress.gemspec +2 -2
  15. data/tests/lib/staticpress/content/theme_test.rb +7 -7
  16. data/tests/lib/staticpress/theme_test.rb +18 -1
  17. data/tests/lib/staticpress_test.rb +10 -3
  18. data/tests/sample_sites/test_blog/config.yml +1 -0
  19. data/tests/sample_sites/test_blog/themes/test_theme/assets/scripts/application.js +4 -0
  20. data/tests/sample_sites/test_blog/themes/test_theme/assets/styles/all.sass +0 -0
  21. data/tests/sample_sites/test_blog/themes/test_theme/includes/list_posts.haml +3 -0
  22. data/tests/sample_sites/test_blog/themes/test_theme/layouts/archive.haml +0 -0
  23. data/tests/sample_sites/test_blog/themes/test_theme/layouts/atom.haml +0 -0
  24. data/tests/sample_sites/test_blog/themes/test_theme/layouts/default.haml +5 -0
  25. data/tests/sample_sites/test_blog/themes/test_theme/layouts/index.haml +0 -0
  26. data/tests/sample_sites/test_blog/themes/test_theme/layouts/post_index.haml +5 -0
  27. data/tests/sample_sites/test_blog/themes/test_theme/views/default.haml +5 -0
  28. data.tar.gz.sig +0 -0
  29. metadata +32 -23
  30. metadata.gz.sig +0 -0
@@ -48,7 +48,7 @@
48
48
  :recent_posts: 5
49
49
  :simple_search: http://google.com/search
50
50
  :email:
51
- :theme: classic
51
+ :theme: basic
52
52
  :twitter_user:
53
53
  :twitter_tweet_count: 4
54
54
  :twitter_show_replies: false
@@ -5,6 +5,7 @@ require 'staticpress/js_object'
5
5
 
6
6
  module Staticpress
7
7
  # IDEA look into configatron https://github.com/markbates/configatron
8
+ # FIXME this class is hard to test
8
9
  class Configuration < JSObject
9
10
  def save
10
11
  (Staticpress.blog_path + 'config.yml').open('w') do |f|
@@ -14,6 +14,10 @@ module Staticpress
14
14
  @root = custom.directory? ? custom : Staticpress.root + 'themes' + @name.to_s
15
15
  end
16
16
 
17
+ def ==(other)
18
+ other.respond_to?(:root) ? (root == other.root) : super
19
+ end
20
+
17
21
  [
18
22
  :include,
19
23
  :layout,
@@ -37,7 +41,7 @@ module Staticpress
37
41
  end
38
42
 
39
43
  def self.theme
40
- @theme ||= new config.theme
44
+ new config.theme
41
45
  end
42
46
  end
43
47
  end
@@ -3,7 +3,7 @@ module Staticpress
3
3
  class Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 1
6
+ PATCH = 2
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, PATCH ].join '.'
File without changes
File without changes
File without changes
File without changes
File without changes
data/staticpress.gemspec CHANGED
@@ -7,13 +7,13 @@ Gem::Specification.new do |s|
7
7
  s.version = Staticpress::Version.to_s
8
8
  s.authors = ['Raving Genius']
9
9
  s.email = ['rg+code@ravinggenius.com']
10
- s.summary = %q{...}
10
+ s.summary = 'Blog-centric static site builder'
11
11
  s.license = 'MIT'
12
12
 
13
13
  s.rubyforge_project = 'staticpress'
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
16
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,feature}{,s}/*`.split("\n")
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
18
18
  s.require_paths = ['lib']
19
19
 
@@ -10,14 +10,14 @@ class ContentThemeTest < ContentBaseTest
10
10
  def setup
11
11
  super
12
12
 
13
- Staticpress::Content::Theme.all
13
+ config.theme = :test_theme
14
14
 
15
15
  @theme_dir = Staticpress::Theme.theme.root
16
16
 
17
- @asset_style_route = Staticpress::Route.from_url_path '/assets/classic/styles/all'
17
+ @asset_style_route = Staticpress::Route.from_url_path '/assets/test_theme/styles/all'
18
18
  @asset_style = Staticpress::Content::Theme.new @asset_style_route, @theme_dir + 'assets' + 'styles' + 'all.sass'
19
19
 
20
- @asset_script_route = Staticpress::Route.from_url_path '/assets/classic/scripts/application.js'
20
+ @asset_script_route = Staticpress::Route.from_url_path '/assets/test_theme/scripts/application.js'
21
21
  @asset_script = Staticpress::Content::Theme.new @asset_script_route, @theme_dir + 'assets' + 'scripts' + 'application.js'
22
22
  end
23
23
 
@@ -50,12 +50,12 @@ class ContentThemeTest < ContentBaseTest
50
50
  end
51
51
 
52
52
  def test_inspect
53
- assert_equal '#<Staticpress::Content::Theme url_path=/assets/classic/styles/all>', @asset_style.inspect
53
+ assert_equal '#<Staticpress::Content::Theme url_path=/assets/test_theme/styles/all>', @asset_style.inspect
54
54
  end
55
55
 
56
56
  def test_output_path
57
- assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'classic' + 'styles' + 'all'), @asset_style.output_path
58
- assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'classic' + 'scripts' + 'application.js'), @asset_script.output_path
57
+ assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'test_theme' + 'styles' + 'all'), @asset_style.output_path
58
+ assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'test_theme' + 'scripts' + 'application.js'), @asset_script.output_path
59
59
  end
60
60
 
61
61
  def test_raw
@@ -98,6 +98,6 @@ class ContentThemeTest < ContentBaseTest
98
98
  end
99
99
 
100
100
  def test_route
101
- assert_equal '/assets/classic/styles/all', @asset_style.route.url_path
101
+ assert_equal '/assets/test_theme/styles/all', @asset_style.route.url_path
102
102
  end
103
103
  end
@@ -1,10 +1,27 @@
1
1
  require_relative '../../test_helper'
2
2
 
3
+ require 'staticpress/helpers'
3
4
  require 'staticpress/theme'
4
5
 
5
6
  class ThemeTest < TestHelper
7
+ include Staticpress::Helpers
8
+
6
9
  def setup
7
- @theme = Staticpress::Theme.new :classic
10
+ Staticpress.blog_path = TEST_BLOG
11
+ config.theme = :test_theme
12
+ @theme = Staticpress::Theme.new :test_theme
13
+ end
14
+
15
+ def test__equalsequals
16
+ assert_operator @theme, :==, Staticpress::Theme.new(:test_theme)
17
+ end
18
+
19
+ def test_root
20
+ assert_equal @theme.root, (Staticpress.blog_path + 'themes' + 'test_theme')
21
+ end
22
+
23
+ def test_theme
24
+ assert_equal @theme, Staticpress::Theme.theme
8
25
  end
9
26
 
10
27
 
@@ -3,10 +3,17 @@ 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
+
6
10
  def test_blog_path
7
- assert_equal Pathname.new('.').expand_path, Staticpress.blog_path
8
- Staticpress.blog_path = 'tests/test_blog'
9
- assert_equal Pathname.new('tests/test_blog').expand_path, Staticpress.blog_path
11
+ assert_equal Pathname.new('tests/sample_sites/test_blog').expand_path, Staticpress.blog_path
12
+ end
13
+
14
+ def test_blog_path=
15
+ Staticpress.blog_path = 'some/other/directory'
16
+ assert_equal Pathname.new('some/other/directory').expand_path, Staticpress.blog_path
10
17
  end
11
18
 
12
19
  def test_root
@@ -2,3 +2,4 @@
2
2
  :plugins:
3
3
  - blockquote
4
4
  :title: Test Blog
5
+ :theme: test_theme
@@ -0,0 +1,4 @@
1
+ (function ($) {
2
+ $(document).ready(function () {
3
+ });
4
+ })(jQuery);
@@ -0,0 +1,3 @@
1
+ %section
2
+ - posts.each do |post|
3
+ %article= post.render_partial
@@ -0,0 +1,5 @@
1
+ %html
2
+ %head
3
+ %title= page.title
4
+ %body
5
+ = yield
@@ -0,0 +1,5 @@
1
+ %html
2
+ %head
3
+ %title= page.title
4
+ %body
5
+ = yield
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: post_index
3
+ ---
4
+
5
+ = partial :list_posts, :posts => page.sub_content
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.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,7 +54,7 @@ date: 2011-10-23 00:00:00.000000000Z
54
54
  dependencies:
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
- requirement: &21717820 !ruby/object:Gem::Requirement
57
+ requirement: &22843760 !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements:
60
60
  - - ! '>='
@@ -62,10 +62,10 @@ dependencies:
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
- version_requirements: *21717820
65
+ version_requirements: *22843760
66
66
  - !ruby/object:Gem::Dependency
67
67
  name: ruby-debug19
68
- requirement: &21717400 !ruby/object:Gem::Requirement
68
+ requirement: &22843340 !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements:
71
71
  - - ! '>='
@@ -73,10 +73,10 @@ dependencies:
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
- version_requirements: *21717400
76
+ version_requirements: *22843340
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: bundler
79
- requirement: &21716980 !ruby/object:Gem::Requirement
79
+ requirement: &22842920 !ruby/object:Gem::Requirement
80
80
  none: false
81
81
  requirements:
82
82
  - - ! '>='
@@ -84,10 +84,10 @@ dependencies:
84
84
  version: '0'
85
85
  type: :runtime
86
86
  prerelease: false
87
- version_requirements: *21716980
87
+ version_requirements: *22842920
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: rack
90
- requirement: &21716560 !ruby/object:Gem::Requirement
90
+ requirement: &22842500 !ruby/object:Gem::Requirement
91
91
  none: false
92
92
  requirements:
93
93
  - - ! '>='
@@ -95,10 +95,10 @@ dependencies:
95
95
  version: '0'
96
96
  type: :runtime
97
97
  prerelease: false
98
- version_requirements: *21716560
98
+ version_requirements: *22842500
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: thor
101
- requirement: &21716140 !ruby/object:Gem::Requirement
101
+ requirement: &22842080 !ruby/object:Gem::Requirement
102
102
  none: false
103
103
  requirements:
104
104
  - - ! '>='
@@ -106,10 +106,10 @@ dependencies:
106
106
  version: '0'
107
107
  type: :runtime
108
108
  prerelease: false
109
- version_requirements: *21716140
109
+ version_requirements: *22842080
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: tilt
112
- requirement: &21715720 !ruby/object:Gem::Requirement
112
+ requirement: &22841660 !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
115
  - - ! '>='
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
- version_requirements: *21715720
120
+ version_requirements: *22841660
121
121
  description:
122
122
  email:
123
123
  - rg+code@ravinggenius.com
@@ -166,15 +166,15 @@ files:
166
166
  - lib/staticpress/theme.rb
167
167
  - lib/staticpress/version.rb
168
168
  - lib/staticpress/view_helpers.rb
169
- - lib/themes/classic/assets/scripts/application.js
170
- - lib/themes/classic/assets/styles/all.sass
171
- - lib/themes/classic/includes/list_posts.haml
172
- - lib/themes/classic/layouts/archive.haml
173
- - lib/themes/classic/layouts/atom.haml
174
- - lib/themes/classic/layouts/default.haml
175
- - lib/themes/classic/layouts/index.haml
176
- - lib/themes/classic/layouts/post_index.haml
177
- - lib/themes/classic/views/default.haml
169
+ - lib/themes/basic/assets/scripts/application.js
170
+ - lib/themes/basic/assets/styles/all.sass
171
+ - lib/themes/basic/includes/list_posts.haml
172
+ - lib/themes/basic/layouts/archive.haml
173
+ - lib/themes/basic/layouts/atom.haml
174
+ - lib/themes/basic/layouts/default.haml
175
+ - lib/themes/basic/layouts/index.haml
176
+ - lib/themes/basic/layouts/post_index.haml
177
+ - lib/themes/basic/views/default.haml
178
178
  - staticpress.gemspec
179
179
  - tests/lib/staticpress/cli_test.rb
180
180
  - tests/lib/staticpress/configuration_test.rb
@@ -215,6 +215,15 @@ files:
215
215
  - tests/sample_sites/test_blog/content/style1.css
216
216
  - tests/sample_sites/test_blog/content/style2.css.sass
217
217
  - tests/sample_sites/test_blog/content/style3.sass
218
+ - tests/sample_sites/test_blog/themes/test_theme/assets/scripts/application.js
219
+ - tests/sample_sites/test_blog/themes/test_theme/assets/styles/all.sass
220
+ - tests/sample_sites/test_blog/themes/test_theme/includes/list_posts.haml
221
+ - tests/sample_sites/test_blog/themes/test_theme/layouts/archive.haml
222
+ - tests/sample_sites/test_blog/themes/test_theme/layouts/atom.haml
223
+ - tests/sample_sites/test_blog/themes/test_theme/layouts/default.haml
224
+ - tests/sample_sites/test_blog/themes/test_theme/layouts/index.haml
225
+ - tests/sample_sites/test_blog/themes/test_theme/layouts/post_index.haml
226
+ - tests/sample_sites/test_blog/themes/test_theme/views/default.haml
218
227
  - tests/test_helper.rb
219
228
  homepage:
220
229
  licenses:
@@ -240,5 +249,5 @@ rubyforge_project: staticpress
240
249
  rubygems_version: 1.8.11
241
250
  signing_key:
242
251
  specification_version: 3
243
- summary: ! '...'
252
+ summary: Blog-centric static site builder
244
253
  test_files: []
metadata.gz.sig CHANGED
Binary file