nesta 0.9.9 → 0.9.10
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.
- data/.gitignore +1 -0
- data/CHANGES +18 -0
- data/Gemfile.lock +13 -17
- data/bin/nesta +13 -4
- data/lib/nesta/app.rb +5 -4
- data/lib/nesta/commands.rb +72 -1
- data/lib/nesta/models.rb +21 -3
- data/lib/nesta/overrides.rb +1 -1
- data/lib/nesta/plugin.rb +33 -0
- data/lib/nesta/version.rb +1 -1
- data/nesta.gemspec +3 -3
- data/spec/atom_spec.rb +1 -2
- data/spec/commands_spec.rb +79 -7
- data/spec/config_spec.rb +0 -2
- data/spec/fixtures/nesta-plugin-test/Gemfile +4 -0
- data/spec/fixtures/nesta-plugin-test/Rakefile +1 -0
- data/spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb +3 -0
- data/spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb +20 -0
- data/spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb +7 -0
- data/spec/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec +24 -0
- data/spec/model_factory.rb +0 -2
- data/spec/models_spec.rb +40 -18
- data/spec/overrides_spec.rb +8 -4
- data/spec/page_spec.rb +5 -11
- data/spec/plugin_spec.rb +51 -0
- data/spec/sitemap_spec.rb +2 -4
- data/spec/spec_helper.rb +35 -30
- data/views/atom.haml +1 -1
- metadata +45 -86
- data/lib/nesta/plugins.rb +0 -15
data/spec/spec_helper.rb
CHANGED
@@ -7,10 +7,6 @@ require 'sinatra'
|
|
7
7
|
|
8
8
|
Test::Unit::TestCase.send :include, Rack::Test::Methods
|
9
9
|
|
10
|
-
Spec::Runner.configure do |config|
|
11
|
-
config.include(RspecHpricotMatchers)
|
12
|
-
end
|
13
|
-
|
14
10
|
module Nesta
|
15
11
|
class App < Sinatra::Base
|
16
12
|
set :environment, :test
|
@@ -21,31 +17,7 @@ end
|
|
21
17
|
require File.expand_path('../lib/nesta/env', File.dirname(__FILE__))
|
22
18
|
require File.expand_path('../lib/nesta/app', File.dirname(__FILE__))
|
23
19
|
|
24
|
-
module FixtureHelper
|
25
|
-
FIXTURE_DIR = File.expand_path('fixtures', File.dirname(__FILE__))
|
26
|
-
|
27
|
-
def create_fixtures_directory
|
28
|
-
FileUtils.mkdir_p(FixtureHelper::FIXTURE_DIR)
|
29
|
-
end
|
30
|
-
|
31
|
-
def remove_fixtures
|
32
|
-
FileUtils.rm_r(FixtureHelper::FIXTURE_DIR, :force => true)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module RequestSpecHelper
|
37
|
-
def app
|
38
|
-
Nesta::App
|
39
|
-
end
|
40
|
-
|
41
|
-
def body
|
42
|
-
last_response.body
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
20
|
module ConfigSpecHelper
|
47
|
-
include FixtureHelper
|
48
|
-
|
49
21
|
def stub_yaml_config
|
50
22
|
@config = {}
|
51
23
|
Nesta::Config.stub!(:yaml_exists?).and_return(true)
|
@@ -65,7 +37,40 @@ module ConfigSpecHelper
|
|
65
37
|
def stub_configuration(options = {})
|
66
38
|
stub_config_key('title', 'My blog', options)
|
67
39
|
stub_config_key('subtitle', 'about stuff', options)
|
68
|
-
|
69
|
-
|
40
|
+
stub_config_key(
|
41
|
+
'content', temp_path('content'), options.merge(:rack_env => true))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
module TempFileHelper
|
46
|
+
TEMP_DIR = File.expand_path('tmp', File.dirname(__FILE__))
|
47
|
+
|
48
|
+
def create_temp_directory
|
49
|
+
FileUtils.mkdir_p(TempFileHelper::TEMP_DIR)
|
50
|
+
end
|
51
|
+
|
52
|
+
def remove_temp_directory
|
53
|
+
FileUtils.rm_r(TempFileHelper::TEMP_DIR, :force => true)
|
54
|
+
end
|
55
|
+
|
56
|
+
def temp_path(base)
|
57
|
+
File.join(TempFileHelper::TEMP_DIR, base)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
Spec::Runner.configure do |config|
|
62
|
+
config.include(RspecHpricotMatchers)
|
63
|
+
|
64
|
+
config.include(ConfigSpecHelper)
|
65
|
+
config.include(TempFileHelper)
|
66
|
+
end
|
67
|
+
|
68
|
+
module RequestSpecHelper
|
69
|
+
def app
|
70
|
+
Nesta::App
|
71
|
+
end
|
72
|
+
|
73
|
+
def body
|
74
|
+
last_response.body
|
70
75
|
end
|
71
76
|
end
|
data/views/atom.haml
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
%title= article.heading
|
22
22
|
%link{ :href => url_for(article), :type => 'text/html', :rel => 'alternate' }
|
23
23
|
%id= atom_id(article)
|
24
|
-
%content(type='html')&= find_and_preserve(absolute_urls(article.body))
|
24
|
+
%content(type='html')&= find_and_preserve(absolute_urls(article.body(self)))
|
25
25
|
%published= article.date(:xmlschema)
|
26
26
|
%updated= article.date(:xmlschema)
|
27
27
|
- article.categories.each do |category|
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nesta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 41
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 9
|
10
|
-
version: 0.9.9
|
5
|
+
version: 0.9.10
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Graham Ashton
|
@@ -15,180 +10,130 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
13
|
+
date: 2011-09-09 00:00:00 +01:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
17
|
name: haml
|
23
|
-
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
19
|
none: false
|
25
20
|
requirements:
|
26
21
|
- - ~>
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 5
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 1
|
32
23
|
version: "3.1"
|
33
24
|
type: :runtime
|
34
25
|
prerelease: false
|
35
|
-
|
26
|
+
version_requirements: *id001
|
36
27
|
- !ruby/object:Gem::Dependency
|
37
28
|
name: sass
|
38
|
-
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
30
|
none: false
|
40
31
|
requirements:
|
41
32
|
- - ~>
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 5
|
44
|
-
segments:
|
45
|
-
- 3
|
46
|
-
- 1
|
47
34
|
version: "3.1"
|
48
35
|
type: :runtime
|
49
36
|
prerelease: false
|
50
|
-
|
37
|
+
version_requirements: *id002
|
51
38
|
- !ruby/object:Gem::Dependency
|
52
39
|
name: maruku
|
53
|
-
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
41
|
none: false
|
55
42
|
requirements:
|
56
43
|
- - ">="
|
57
44
|
- !ruby/object:Gem::Version
|
58
|
-
hash: 7
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
- 6
|
62
|
-
- 0
|
63
45
|
version: 0.6.0
|
64
46
|
type: :runtime
|
65
47
|
prerelease: false
|
66
|
-
|
48
|
+
version_requirements: *id003
|
67
49
|
- !ruby/object:Gem::Dependency
|
68
50
|
name: RedCloth
|
69
|
-
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
52
|
none: false
|
71
53
|
requirements:
|
72
54
|
- - ~>
|
73
55
|
- !ruby/object:Gem::Version
|
74
|
-
hash: 31
|
75
|
-
segments:
|
76
|
-
- 4
|
77
|
-
- 2
|
78
56
|
version: "4.2"
|
79
57
|
type: :runtime
|
80
58
|
prerelease: false
|
81
|
-
|
59
|
+
version_requirements: *id004
|
82
60
|
- !ruby/object:Gem::Dependency
|
83
61
|
name: sinatra
|
84
|
-
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
63
|
none: false
|
86
64
|
requirements:
|
87
65
|
- - "="
|
88
66
|
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
segments:
|
91
|
-
- 1
|
92
|
-
- 1
|
93
|
-
- 2
|
94
|
-
version: 1.1.2
|
67
|
+
version: 1.2.6
|
95
68
|
type: :runtime
|
96
69
|
prerelease: false
|
97
|
-
|
70
|
+
version_requirements: *id005
|
98
71
|
- !ruby/object:Gem::Dependency
|
99
72
|
name: shotgun
|
100
|
-
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
101
74
|
none: false
|
102
75
|
requirements:
|
103
76
|
- - ">="
|
104
77
|
- !ruby/object:Gem::Version
|
105
|
-
hash: 27
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
- 8
|
109
78
|
version: "0.8"
|
110
79
|
type: :runtime
|
111
80
|
prerelease: false
|
112
|
-
|
81
|
+
version_requirements: *id006
|
113
82
|
- !ruby/object:Gem::Dependency
|
114
83
|
name: hpricot
|
115
|
-
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
116
85
|
none: false
|
117
86
|
requirements:
|
118
87
|
- - "="
|
119
88
|
- !ruby/object:Gem::Version
|
120
|
-
|
121
|
-
segments:
|
122
|
-
- 0
|
123
|
-
- 8
|
124
|
-
- 3
|
125
|
-
version: 0.8.3
|
89
|
+
version: 0.8.4
|
126
90
|
type: :development
|
127
91
|
prerelease: false
|
128
|
-
|
92
|
+
version_requirements: *id007
|
129
93
|
- !ruby/object:Gem::Dependency
|
130
94
|
name: rack-test
|
131
|
-
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
132
96
|
none: false
|
133
97
|
requirements:
|
134
98
|
- - "="
|
135
99
|
- !ruby/object:Gem::Version
|
136
|
-
|
137
|
-
segments:
|
138
|
-
- 0
|
139
|
-
- 5
|
140
|
-
- 7
|
141
|
-
version: 0.5.7
|
100
|
+
version: 0.6.1
|
142
101
|
type: :development
|
143
102
|
prerelease: false
|
144
|
-
|
103
|
+
version_requirements: *id008
|
145
104
|
- !ruby/object:Gem::Dependency
|
146
105
|
name: rspec
|
147
|
-
|
106
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
148
107
|
none: false
|
149
108
|
requirements:
|
150
109
|
- - "="
|
151
110
|
- !ruby/object:Gem::Version
|
152
|
-
hash: 27
|
153
|
-
segments:
|
154
|
-
- 1
|
155
|
-
- 3
|
156
|
-
- 0
|
157
111
|
version: 1.3.0
|
158
112
|
type: :development
|
159
113
|
prerelease: false
|
160
|
-
|
114
|
+
version_requirements: *id009
|
161
115
|
- !ruby/object:Gem::Dependency
|
162
116
|
name: rspec_hpricot_matchers
|
163
|
-
|
117
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
164
118
|
none: false
|
165
119
|
requirements:
|
166
120
|
- - "="
|
167
121
|
- !ruby/object:Gem::Version
|
168
|
-
hash: 15
|
169
|
-
segments:
|
170
|
-
- 1
|
171
|
-
- 0
|
172
122
|
version: "1.0"
|
173
123
|
type: :development
|
174
124
|
prerelease: false
|
175
|
-
|
125
|
+
version_requirements: *id010
|
176
126
|
- !ruby/object:Gem::Dependency
|
177
127
|
name: test-unit
|
178
|
-
|
128
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
179
129
|
none: false
|
180
130
|
requirements:
|
181
131
|
- - "="
|
182
132
|
- !ruby/object:Gem::Version
|
183
|
-
hash: 25
|
184
|
-
segments:
|
185
|
-
- 1
|
186
|
-
- 2
|
187
|
-
- 3
|
188
133
|
version: 1.2.3
|
189
134
|
type: :development
|
190
135
|
prerelease: false
|
191
|
-
|
136
|
+
version_requirements: *id011
|
192
137
|
description: |
|
193
138
|
Nesta is a lightweight Content Management System, written in Ruby using
|
194
139
|
the Sinatra web framework. Nesta has the simplicity of a static site
|
@@ -231,18 +176,25 @@ files:
|
|
231
176
|
- lib/nesta/nesta.rb
|
232
177
|
- lib/nesta/overrides.rb
|
233
178
|
- lib/nesta/path.rb
|
234
|
-
- lib/nesta/
|
179
|
+
- lib/nesta/plugin.rb
|
235
180
|
- lib/nesta/version.rb
|
236
181
|
- nesta.gemspec
|
237
182
|
- scripts/import-from-mephisto
|
238
183
|
- spec/atom_spec.rb
|
239
184
|
- spec/commands_spec.rb
|
240
185
|
- spec/config_spec.rb
|
186
|
+
- spec/fixtures/nesta-plugin-test/Gemfile
|
187
|
+
- spec/fixtures/nesta-plugin-test/Rakefile
|
188
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb
|
189
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb
|
190
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb
|
191
|
+
- spec/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec
|
241
192
|
- spec/model_factory.rb
|
242
193
|
- spec/models_spec.rb
|
243
194
|
- spec/overrides_spec.rb
|
244
195
|
- spec/page_spec.rb
|
245
196
|
- spec/path_spec.rb
|
197
|
+
- spec/plugin_spec.rb
|
246
198
|
- spec/sitemap_spec.rb
|
247
199
|
- spec/spec.opts
|
248
200
|
- spec/spec_helper.rb
|
@@ -286,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
286
238
|
requirements:
|
287
239
|
- - ">="
|
288
240
|
- !ruby/object:Gem::Version
|
289
|
-
hash:
|
241
|
+
hash: 279403347508023079
|
290
242
|
segments:
|
291
243
|
- 0
|
292
244
|
version: "0"
|
@@ -295,14 +247,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
247
|
requirements:
|
296
248
|
- - ">="
|
297
249
|
- !ruby/object:Gem::Version
|
298
|
-
hash:
|
250
|
+
hash: 279403347508023079
|
299
251
|
segments:
|
300
252
|
- 0
|
301
253
|
version: "0"
|
302
254
|
requirements: []
|
303
255
|
|
304
256
|
rubyforge_project: nesta
|
305
|
-
rubygems_version: 1.
|
257
|
+
rubygems_version: 1.6.2
|
306
258
|
signing_key:
|
307
259
|
specification_version: 3
|
308
260
|
summary: Ruby CMS, written in Sinatra
|
@@ -310,11 +262,18 @@ test_files:
|
|
310
262
|
- spec/atom_spec.rb
|
311
263
|
- spec/commands_spec.rb
|
312
264
|
- spec/config_spec.rb
|
265
|
+
- spec/fixtures/nesta-plugin-test/Gemfile
|
266
|
+
- spec/fixtures/nesta-plugin-test/Rakefile
|
267
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb
|
268
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb
|
269
|
+
- spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb
|
270
|
+
- spec/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec
|
313
271
|
- spec/model_factory.rb
|
314
272
|
- spec/models_spec.rb
|
315
273
|
- spec/overrides_spec.rb
|
316
274
|
- spec/page_spec.rb
|
317
275
|
- spec/path_spec.rb
|
276
|
+
- spec/plugin_spec.rb
|
318
277
|
- spec/sitemap_spec.rb
|
319
278
|
- spec/spec.opts
|
320
279
|
- spec/spec_helper.rb
|
data/lib/nesta/plugins.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Nesta
|
2
|
-
module Plugins
|
3
|
-
def self.load_local_plugins
|
4
|
-
plugins = Dir.glob(File.expand_path('../plugins/*', File.dirname(__FILE__)))
|
5
|
-
plugins.each { |plugin| require_plugin(plugin) }
|
6
|
-
end
|
7
|
-
|
8
|
-
private
|
9
|
-
def self.require_plugin(plugin)
|
10
|
-
require File.join(plugin, 'lib', File.basename(plugin))
|
11
|
-
rescue LoadError => e
|
12
|
-
$stderr.write("Couldn't load plugins/#{File.basename(plugin)}: #{e}\n")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|