nesta 0.11.1 → 0.12.0

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.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.gitmodules +6 -0
  3. data/.travis.yml +9 -4
  4. data/CHANGES +18 -2
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +70 -54
  7. data/LICENSE +1 -1
  8. data/RELEASING.md +5 -6
  9. data/Rakefile +20 -3
  10. data/lib/nesta/app.rb +4 -8
  11. data/lib/nesta/commands/command.rb +1 -2
  12. data/lib/nesta/commands/demo/content.rb +23 -5
  13. data/lib/nesta/commands/theme/install.rb +9 -7
  14. data/lib/nesta/helpers.rb +14 -0
  15. data/lib/nesta/models.rb +26 -22
  16. data/lib/nesta/navigation.rb +1 -1
  17. data/lib/nesta/version.rb +1 -1
  18. data/nesta.gemspec +10 -11
  19. data/templates/config/config.yml +1 -1
  20. data/{spec → test}/fixtures/nesta-plugin-test/Gemfile +0 -0
  21. data/{spec → test}/fixtures/nesta-plugin-test/Rakefile +0 -0
  22. data/{spec → test}/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb +0 -0
  23. data/{spec → test}/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb +0 -0
  24. data/{spec → test}/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb +0 -0
  25. data/{spec → test}/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec +0 -0
  26. data/test/integration/atom_feed_test.rb +178 -0
  27. data/test/integration/commands/demo/content_test.rb +31 -0
  28. data/test/integration/commands/edit_test.rb +21 -0
  29. data/test/integration/commands/new_test.rb +120 -0
  30. data/test/integration/commands/plugin/create_test.rb +128 -0
  31. data/test/integration/commands/theme/create_test.rb +35 -0
  32. data/test/integration/commands/theme/enable_test.rb +22 -0
  33. data/test/integration/commands/theme/install_test.rb +62 -0
  34. data/test/integration/default_theme_test.rb +220 -0
  35. data/test/integration/overrides_test.rb +118 -0
  36. data/test/integration/route_handlers_test.rb +96 -0
  37. data/test/integration/sitemap_test.rb +85 -0
  38. data/test/integration_test_helper.rb +61 -0
  39. data/test/support/model_factory.rb +169 -0
  40. data/test/support/silence_commands_during_tests.rb +5 -0
  41. data/test/support/temporary_files.rb +33 -0
  42. data/test/support/test_configuration.rb +19 -0
  43. data/test/test_helper.rb +26 -0
  44. data/test/unit/commands_test.rb +23 -0
  45. data/test/unit/config_test.rb +138 -0
  46. data/test/unit/file_model_test.rb +71 -0
  47. data/test/unit/menu_test.rb +82 -0
  48. data/test/unit/page_test.rb +571 -0
  49. data/test/unit/path_test.rb +41 -0
  50. data/test/unit/plugin_test.rb +47 -0
  51. data/views/master.sass +1 -1
  52. metadata +81 -85
  53. data/smoke-test.sh +0 -107
  54. data/spec/atom_spec.rb +0 -141
  55. data/spec/commands/demo/content_spec.rb +0 -65
  56. data/spec/commands/edit_spec.rb +0 -27
  57. data/spec/commands/new_spec.rb +0 -88
  58. data/spec/commands/plugin/create_spec.rb +0 -97
  59. data/spec/commands/system_spec.rb +0 -25
  60. data/spec/commands/theme/create_spec.rb +0 -41
  61. data/spec/commands/theme/enable_spec.rb +0 -44
  62. data/spec/commands/theme/install_spec.rb +0 -56
  63. data/spec/config_spec.rb +0 -127
  64. data/spec/model_factory.rb +0 -92
  65. data/spec/models_spec.rb +0 -700
  66. data/spec/overrides_spec.rb +0 -132
  67. data/spec/page_spec.rb +0 -560
  68. data/spec/path_spec.rb +0 -28
  69. data/spec/plugin_spec.rb +0 -51
  70. data/spec/sitemap_spec.rb +0 -105
  71. data/spec/spec_helper.rb +0 -114
@@ -0,0 +1,41 @@
1
+ require 'test_helper'
2
+
3
+ describe Nesta::Path do
4
+ def root
5
+ '/path/to/site/on/filesystem'
6
+ end
7
+
8
+ describe '.local' do
9
+ it 'returns root path of site on filesystem' do
10
+ with_app_root(root) do
11
+ assert_equal root, Nesta::Path.local
12
+ end
13
+ end
14
+
15
+ it "should return path for file within site's directory" do
16
+ with_app_root(root) do
17
+ assert_equal "#{root}/foo/bar", Nesta::Path.local('foo/bar')
18
+ end
19
+ end
20
+
21
+ it 'should combine path components' do
22
+ with_app_root(root) do
23
+ assert_equal "#{root}/foo/bar", Nesta::Path.local('foo', 'bar')
24
+ end
25
+ end
26
+ end
27
+
28
+ describe '.themes' do
29
+ it 'should return themes path' do
30
+ with_app_root(root) do
31
+ assert_equal "#{root}/themes", Nesta::Path.themes
32
+ end
33
+ end
34
+
35
+ it 'should return path for file within themes directory' do
36
+ with_app_root(root) do
37
+ assert_equal "#{root}/themes/foo/bar", Nesta::Path.themes('foo/bar')
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,47 @@
1
+ require 'test_helper'
2
+
3
+ describe Nesta::Plugin do
4
+ def remove_plugin_from_list_of_required_files
5
+ $LOADED_FEATURES.delete_if do |path|
6
+ path =~ /nesta-plugin-test/
7
+ end
8
+ end
9
+
10
+ def remove_plugin_constants
11
+ Nesta::Plugin::Test.send(:remove_const, :VERSION)
12
+ rescue NameError
13
+ end
14
+
15
+ before do
16
+ @plugin_lib_path = File.expand_path(
17
+ File.join(%w(.. fixtures nesta-plugin-test lib)), File.dirname(__FILE__))
18
+ $LOAD_PATH.unshift(@plugin_lib_path)
19
+ Nesta::Plugin.loaded.clear
20
+ end
21
+
22
+ after do
23
+ $LOAD_PATH.shift if $LOAD_PATH[0] == @plugin_lib_path
24
+ remove_plugin_from_list_of_required_files
25
+ remove_plugin_constants
26
+ end
27
+
28
+ it 'must be required in order to load' do
29
+ assert Nesta::Plugin.loaded.empty?, 'should be empty'
30
+ end
31
+
32
+ it 'records loaded plugins' do
33
+ require 'nesta-plugin-test'
34
+ assert_equal ['nesta-plugin-test'], Nesta::Plugin.loaded
35
+ end
36
+
37
+ it 'loads the plugin module' do
38
+ require 'nesta-plugin-test'
39
+ Nesta::Plugin::Test::VERSION
40
+ end
41
+
42
+ it 'initializes the plugin' do
43
+ require 'nesta-plugin-test'
44
+ Nesta::Plugin.initialize_plugins
45
+ assert Nesta::Page.respond_to?(:method_added_by_plugin), 'not initialized'
46
+ end
47
+ end
@@ -74,7 +74,7 @@ blockquote
74
74
  border-left: 5px solid $tint
75
75
 
76
76
  font-style: italic
77
- color: $base-color + #555
77
+ color: adjust-color($base-color, $red: 55, $green: 55, $blue: 55)
78
78
 
79
79
  pre
80
80
  display: block
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nesta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graham Ashton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2020-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rack
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdiscount
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,117 +81,131 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.2'
83
83
  - !ruby/object:Gem::Dependency
84
- name: sass
84
+ name: sassc
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '3.1'
89
+ version: '2.2'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '3.1'
96
+ version: '2.2'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sinatra
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.4'
103
+ version: '2.0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.4'
110
+ version: '2.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: tilt
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.4'
117
+ version: '2.0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.4'
124
+ version: '2.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: mr-sparkle
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 0.0.2
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 0.0.2
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rack-test
140
+ name: byebug
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 0.6.1
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 0.6.1
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rspec
154
+ name: capybara
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 2.14.0
159
+ version: '2.0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 2.14.0
166
+ version: '2.0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: test-unit
168
+ name: minitest
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '='
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.2.3
173
+ version: '5.0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '='
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.2.3
180
+ version: '5.0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: webrat
182
+ name: minitest-reporters
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - "~>"
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 0.7.3
187
+ version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - "~>"
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rake
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
193
207
  - !ruby/object:Gem::Version
194
- version: 0.7.3
208
+ version: '0'
195
209
  description: |
196
210
  Nesta is a lightweight Content Management System, written in Ruby using
197
211
  the Sinatra web framework. Nesta has the simplicity of a static site
@@ -212,6 +226,7 @@ extensions: []
212
226
  extra_rdoc_files: []
213
227
  files:
214
228
  - ".gitignore"
229
+ - ".gitmodules"
215
230
  - ".hound.yml"
216
231
  - ".rspec"
217
232
  - ".travis.yml"
@@ -251,31 +266,6 @@ files:
251
266
  - lib/nesta/version.rb
252
267
  - nesta.gemspec
253
268
  - scripts/import-from-mephisto
254
- - smoke-test.sh
255
- - spec/atom_spec.rb
256
- - spec/commands/demo/content_spec.rb
257
- - spec/commands/edit_spec.rb
258
- - spec/commands/new_spec.rb
259
- - spec/commands/plugin/create_spec.rb
260
- - spec/commands/system_spec.rb
261
- - spec/commands/theme/create_spec.rb
262
- - spec/commands/theme/enable_spec.rb
263
- - spec/commands/theme/install_spec.rb
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
271
- - spec/model_factory.rb
272
- - spec/models_spec.rb
273
- - spec/overrides_spec.rb
274
- - spec/page_spec.rb
275
- - spec/path_spec.rb
276
- - spec/plugin_spec.rb
277
- - spec/sitemap_spec.rb
278
- - spec/spec_helper.rb
279
269
  - templates/Gemfile
280
270
  - templates/Rakefile
281
271
  - templates/config.ru
@@ -295,6 +285,37 @@ files:
295
285
  - templates/themes/views/layout.haml
296
286
  - templates/themes/views/master.sass
297
287
  - templates/themes/views/page.haml
288
+ - test/fixtures/nesta-plugin-test/Gemfile
289
+ - test/fixtures/nesta-plugin-test/Rakefile
290
+ - test/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb
291
+ - test/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb
292
+ - test/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb
293
+ - test/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec
294
+ - test/integration/atom_feed_test.rb
295
+ - test/integration/commands/demo/content_test.rb
296
+ - test/integration/commands/edit_test.rb
297
+ - test/integration/commands/new_test.rb
298
+ - test/integration/commands/plugin/create_test.rb
299
+ - test/integration/commands/theme/create_test.rb
300
+ - test/integration/commands/theme/enable_test.rb
301
+ - test/integration/commands/theme/install_test.rb
302
+ - test/integration/default_theme_test.rb
303
+ - test/integration/overrides_test.rb
304
+ - test/integration/route_handlers_test.rb
305
+ - test/integration/sitemap_test.rb
306
+ - test/integration_test_helper.rb
307
+ - test/support/model_factory.rb
308
+ - test/support/silence_commands_during_tests.rb
309
+ - test/support/temporary_files.rb
310
+ - test/support/test_configuration.rb
311
+ - test/test_helper.rb
312
+ - test/unit/commands_test.rb
313
+ - test/unit/config_test.rb
314
+ - test/unit/file_model_test.rb
315
+ - test/unit/menu_test.rb
316
+ - test/unit/page_test.rb
317
+ - test/unit/path_test.rb
318
+ - test/unit/plugin_test.rb
298
319
  - views/analytics.haml
299
320
  - views/atom.haml
300
321
  - views/categories.haml
@@ -332,33 +353,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
353
  - !ruby/object:Gem::Version
333
354
  version: '0'
334
355
  requirements: []
335
- rubyforge_project: nesta
336
- rubygems_version: 2.4.5
356
+ rubygems_version: 3.1.2
337
357
  signing_key:
338
358
  specification_version: 4
339
359
  summary: Ruby CMS, written in Sinatra
340
- test_files:
341
- - spec/atom_spec.rb
342
- - spec/commands/demo/content_spec.rb
343
- - spec/commands/edit_spec.rb
344
- - spec/commands/new_spec.rb
345
- - spec/commands/plugin/create_spec.rb
346
- - spec/commands/system_spec.rb
347
- - spec/commands/theme/create_spec.rb
348
- - spec/commands/theme/enable_spec.rb
349
- - spec/commands/theme/install_spec.rb
350
- - spec/config_spec.rb
351
- - spec/fixtures/nesta-plugin-test/Gemfile
352
- - spec/fixtures/nesta-plugin-test/Rakefile
353
- - spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test.rb
354
- - spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/init.rb
355
- - spec/fixtures/nesta-plugin-test/lib/nesta-plugin-test/version.rb
356
- - spec/fixtures/nesta-plugin-test/nesta-plugin-test.gemspec
357
- - spec/model_factory.rb
358
- - spec/models_spec.rb
359
- - spec/overrides_spec.rb
360
- - spec/page_spec.rb
361
- - spec/path_spec.rb
362
- - spec/plugin_spec.rb
363
- - spec/sitemap_spec.rb
364
- - spec/spec_helper.rb
360
+ test_files: []
@@ -1,107 +0,0 @@
1
- #!/bin/sh
2
-
3
- # This script just makes it easy to test that Nesta can install a new
4
- # site, launch it, and that it runs properly on supported versions of
5
- # Ruby.
6
- #
7
- # It assumes you've got the relevant versions of Ruby installed locally
8
- # via chruby.
9
-
10
-
11
- source /usr/local/opt/chruby/share/chruby/chruby.sh
12
-
13
- RUBIES="ruby-2.0.0-p598 ruby-2.1.5 ruby-2.2.1"
14
-
15
-
16
- ## Functions
17
-
18
- log()
19
- {
20
- cat <<-EOF
21
-
22
- ###############################################################################
23
- ##
24
- ## $1
25
- ##
26
- ###############################################################################
27
-
28
- EOF
29
- }
30
-
31
- nesta_version()
32
- {
33
- grep VERSION lib/nesta/version.rb | sed -e 's/ //g' | cut -f 2 -d "'"
34
- }
35
-
36
- gem_file()
37
- {
38
- echo "nesta-$(nesta_version).gem"
39
- }
40
-
41
- run_with_ruby()
42
- {
43
- chruby-exec $RUBY_VERSION -- $@
44
- }
45
-
46
- get_ruby()
47
- {
48
- # Why not just use RUBY_VERSION? Because tmux can prevent child
49
- # processes from changing the local version if the RBENV_VERSION
50
- # variable is set in another session. If we don't notice we'll think
51
- # we've been testing Nesta under multiple versions, but in fact
52
- # we'll just have been testing it under the same copy of Ruby every
53
- # time.
54
- run_with_ruby ruby --version | cut -f 2 -d ' '
55
- }
56
-
57
- run_tests()
58
- {
59
- run_with_ruby bundle install
60
- run_with_ruby bundle exec rake spec
61
- }
62
-
63
- build_and_install()
64
- {
65
- echo rm -f pkg/$(gem_file)
66
- run_with_ruby bundle exec rake install
67
- }
68
-
69
- site_folder()
70
- {
71
- echo "test-site-${RUBY_VERSION}"
72
- }
73
-
74
- create_and_test_new_site()
75
- {
76
- run_with_ruby bundle exec nesta new $(site_folder)
77
- cd $(site_folder)
78
- run_with_ruby bundle install
79
- run_with_ruby bundle exec nesta demo:content
80
-
81
- log "Starting server in $(site_folder)"
82
- set +e
83
- run_with_ruby bundle exec mr-sparkle
84
- set -e
85
-
86
- cd - >/dev/null
87
- rm -rf $(site_folder)
88
- }
89
-
90
-
91
- ## Main program
92
-
93
- set -e
94
- [ "$DEBUG" ] && set -x
95
-
96
- for RUBY_VERSION in $RUBIES; do
97
- log "Rebuilding nesta gem with Ruby $(get_ruby)"
98
-
99
- run_tests
100
- build_and_install
101
- create_and_test_new_site
102
-
103
- read -p "Was Ruby ${RUBY_VERSION} okay? Press return to continue..."
104
- done
105
-
106
- rm -f .ruby-version
107
- log "Reset Ruby version to $(get_ruby)"