zen 0.2.6.1 → 0.2.7

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.
@@ -1,7 +1,6 @@
1
- script: "rvm gemset import .gems; rake test"
1
+ script: "gem install ramaze; rake test"
2
2
  rvm:
3
3
  - 1.9.2
4
-
5
- notifications:
6
- recipients:
7
- - info@yorickpeterse.com
4
+ - rbx
5
+ - jruby
6
+ - 1.8.7
@@ -1,3 +1,9 @@
1
+ ## 0.2.7 - June 16th, 2011
2
+
3
+ * Started using Ramaze.setup for Gem management.
4
+ * Websites can no longer be marked as "offline", this was a rather useless feature anyway.
5
+ * Fixed various bugs
6
+
1
7
  ## 0.2.6.1 - June 1st, 2011
2
8
 
3
9
  * Dropped Zen.settings and modified the settings plugin so that it works properly when
data/MANIFEST CHANGED
@@ -1,4 +1,3 @@
1
- .gems
2
1
  .travis.yml
3
2
  AUTHORS
4
3
  CHANGELOG.md
@@ -145,6 +144,7 @@ lib/zen/package/settings/migrations/.gitkeep
145
144
  lib/zen/package/settings/migrations/1295597111_create_schema.rb
146
145
  lib/zen/package/settings/migrations/1299538742_add_language_key.rb
147
146
  lib/zen/package/settings/migrations/1303196915_settings_plugin.rb
147
+ lib/zen/package/settings/migrations/1307796295_remove_website_enabled.rb
148
148
  lib/zen/package/users/lib/users/controller/access_rules.rb
149
149
  lib/zen/package/users/lib/users/controller/user_groups.rb
150
150
  lib/zen/package/users/lib/users/controller/users.rb
data/README.md CHANGED
@@ -74,7 +74,7 @@ easier to read code in terminals or when using split view modes.
74
74
  ## Community
75
75
 
76
76
  * [Website][zen website]
77
- * Mailing list
77
+ * [Mailing list][mailing list]
78
78
 
79
79
  Zen does not have it's own IRC channel at this time but you can usually find me in any
80
80
  of the following channels on Freenode:
@@ -92,3 +92,4 @@ the file "LICENSE".
92
92
  [zen website]: http://zen-cms.com/
93
93
  [zen documentation]: http://zen-cms.com/userguide/
94
94
  [nvie branch model]: http://nvie.com/posts/a-successful-git-branching-model/
95
+ [mailing list]: https://groups.google.com/forum/#!forum/zen-cms
data/bin/zen CHANGED
@@ -1,7 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'ramaze'
2
3
  require File.expand_path('../../lib/zen/version', __FILE__)
3
4
 
4
- require 'commander'
5
+ Ramaze.setup(:verbose => false) do
6
+ gem 'commander', ['~> 4.0.4']
7
+ end
8
+
5
9
  require 'commander/import'
6
10
 
7
11
  # Set the extra information message
data/lib/zen.rb CHANGED
@@ -1,9 +1,14 @@
1
+ require 'rubygems'
1
2
  require 'ramaze'
2
- require 'sequel'
3
- require 'bcrypt'
4
- require 'sequel_sluggable'
5
- require 'loofah'
6
3
  require 'yaml'
4
+
5
+ Ramaze.setup(:verbose => false) do
6
+ gem 'sequel' , ['~> 3.24.1']
7
+ gem 'bcrypt-ruby' , ['~> 2.1.4'], :lib => 'bcrypt'
8
+ gem 'sequel_sluggable', ['~> 0.0.6']
9
+ gem 'loofah' , ['~> 1.0.0']
10
+ end
11
+
7
12
  require __DIR__('zen/version')
8
13
 
9
14
  ##
@@ -17,8 +17,7 @@ module Zen
17
17
  # The index method acts as a catch-all method. Based on the requested URI
18
18
  # the correct template group/file will be loaded. If no templates are found
19
19
  # a 404 template will be loaded. If that's not found either a default error
20
- # will be shown. If the website is offline we'll try to load the template
21
- # "offline", if it isn't there a regular message will be displayed.
20
+ # will be shown.
22
21
  #
23
22
  # @author Yorick Peterse
24
23
  # @since 0.1
@@ -53,27 +52,16 @@ module Zen
53
52
  group_path = File.join(theme_path, group)
54
53
  template_path = File.join(theme_path, group, "#{template}.xhtml")
55
54
 
56
- # Is the website down?
57
- if plugin(:settings, :get, :website_enabled).value === '0'
58
- offline_path = File.join(theme_path, 'offline.xhtml')
59
-
60
- if File.exist?(offline_path)
61
- render_file(offline_path)
62
- else
63
- respond(lang('zen_general.errors.website_offline'))
64
- end
55
+ # Check if the group exists
56
+ if File.directory?(group_path) and File.exists?(template_path)
57
+ render_file(template_path)
65
58
  else
66
- # Check if the group exists
67
- if File.directory?(group_path) and File.exists?(template_path)
68
- render_file(template_path)
59
+ not_found = File.join(theme_path, '404.xhtml')
60
+
61
+ if File.exist?(not_found)
62
+ respond(render_file(not_found), 404)
69
63
  else
70
- not_found = File.join(theme_path, '404.xhtml')
71
-
72
- if File.exist?(not_found)
73
- respond(render_file(not_found), 404)
74
- else
75
- respond(lang('zen_general.errors.no_templates'), 404)
76
- end
64
+ respond(lang('zen_general.errors.no_templates'), 404)
77
65
  end
78
66
  end
79
67
  end
@@ -11,7 +11,6 @@ labels:
11
11
  errors:
12
12
  csrf : 'The specified request can not be executed without a valid CSRF token.'
13
13
  not_authorized : 'You are not authorized to access the current page.'
14
- website_offline : 'This website is currently offline.'
15
14
  no_templates : 'No templates were found for the given action.'
16
15
  no_theme : 'No theme has been specified.'
17
16
  invalid_request : 'The request could not be executed as the specified data is incorrect.'
@@ -11,7 +11,6 @@ labels:
11
11
  errors:
12
12
  csrf : 'De actie kan niet worden uitgevoerd zonder een geldige CSRF token.'
13
13
  not_authorized : 'U bent niet toegestaan om de huidige pagina te bekijken.'
14
- website_offline: 'Deze website is momenteel offline.'
15
14
  no_templates : 'Er konden geen sjablonen worden gevonden voor de huidige actie.'
16
15
  no_theme : 'Er is geen thema ingesteld.'
17
16
  invalid_request: 'De actie kon niet worden uitgevoerd omdat de data onjuist is.'
@@ -49,12 +49,14 @@ module Menus
49
49
  :limit => 20,
50
50
  :offset => 0,
51
51
  :menu => nil,
52
- :sub => true
52
+ :sub => true,
53
+ :order => :asc
53
54
  }.merge(options)
54
55
 
55
56
  validate_type(@options[:limit] , :limit , [Integer, Fixnum])
56
57
  validate_type(@options[:offset], :offset, [Integer, Fixnum])
57
- validate_type(@options[:menu] , :menu , [String, Integer, Fixnum])
58
+ validate_type(@options[:menu] , :menu , [String , Integer, Fixnum])
59
+ validate_type(@options[:order] , :order , [String , Symbol])
58
60
  end
59
61
 
60
62
  ##
@@ -77,6 +79,7 @@ module Menus
77
79
  # Get all menu items
78
80
  menu_items = MenuItem.filter(:menu_id => menu.id, :parent_id => nil) \
79
81
  .limit(@options[:limit], @options[:offset]) \
82
+ .order(:order.send(@options[:order])) \
80
83
  .all
81
84
 
82
85
  @g = Ramaze::Gestalt.new
@@ -85,11 +88,11 @@ module Menus
85
88
 
86
89
  # Set the attributes for the main <ul> elements
87
90
  if !menu.css_class.nil?
88
- attributes[:class] = menu.css_class
91
+ attributes[:class] = menu.css_class if !menu.css_class.empty?
89
92
  end
90
93
 
91
94
  if !menu.css_id.nil?
92
- attributes[:id] = menu.css_id
95
+ attributes[:id] = menu.css_id if !menu.css_id.empty?
93
96
  end
94
97
 
95
98
  # Time to build the HTML
@@ -117,11 +120,11 @@ module Menus
117
120
  attributes = {}
118
121
 
119
122
  if !item.css_class.nil?
120
- attributes[:class] = item.css_class
123
+ attributes[:class] = item.css_class if !item.css_class.empty?
121
124
  end
122
125
 
123
126
  if !item.css_id.nil?
124
- attributes[:id] = item.css_id
127
+ attributes[:id] = item.css_id if !item.css_id.empty?
125
128
  end
126
129
 
127
130
  # Get all child elements
@@ -34,8 +34,6 @@ Zen::Theme::Registered.each do |name, theme|
34
34
  theme_hash[name] = name
35
35
  end
36
36
 
37
- # ------
38
-
39
37
  # Register the plugin
40
38
  Zen::Plugin.add do |plugin|
41
39
  plugin.name = 'settings'
@@ -74,19 +72,6 @@ plugin(:settings, :register) do |setting|
74
72
  setting.type = 'textarea'
75
73
  end
76
74
 
77
- plugin(:settings, :register) do |setting|
78
- setting.title = lang('settings.labels.website_enabled')
79
- setting.description = lang('settings.placeholders.website_enabled')
80
- setting.name = 'website_enabled'
81
- setting.group = 'general'
82
- setting.type = 'radio'
83
- setting.default = '1'
84
- setting.values = {
85
- lang('zen_general.special.boolean_hash.true') => '1',
86
- lang('zen_general.special.boolean_hash.false') => '0'
87
- }
88
- end
89
-
90
75
  plugin(:settings, :register) do |setting|
91
76
  setting.title = lang('settings.labels.language')
92
77
  setting.description = lang('settings.placeholders.language')
@@ -5,7 +5,6 @@ titles:
5
5
  labels:
6
6
  website_name : 'Website name'
7
7
  website_description : 'Website description'
8
- website_enabled : 'Website enabled'
9
8
  language : 'Language'
10
9
  frontend_language : 'Frontend language'
11
10
  default_section : 'Default section'
@@ -16,7 +15,6 @@ labels:
16
15
  placeholders:
17
16
  website_name : 'The name of the website.'
18
17
  website_description : 'The description of the website.'
19
- website_enabled : 'Whether or not the website is available to non admins.'
20
18
  language : 'The language to use for the system.'
21
19
  default_section : 'The default section to use on the homepage.'
22
20
  theme : 'The frontend theme to use.'
@@ -5,7 +5,6 @@ titles:
5
5
  labels:
6
6
  website_name : 'Website naam'
7
7
  website_description: 'Website beschrijving'
8
- website_enable : 'Website beschikbaar'
9
8
  language : 'Taal'
10
9
  frontend_langauge : 'Taal voor bezoekers'
11
10
  default_section : 'Standaard sectie'
@@ -16,7 +15,6 @@ labels:
16
15
  placeholders:
17
16
  website_name : 'De naam van de website.'
18
17
  website_description: 'De beschrijving van de website.'
19
- website_enabled : 'Is de website wel of niet beschikbaar?'
20
18
  language : 'De taal die gebruikt moet worden voor het admin gedeelte.'
21
19
  default_section : 'De standaard sectie die moet worden gebruikt.'
22
20
  theme : 'Het thema dat bezoekers zullen zien.'
@@ -0,0 +1,13 @@
1
+ Sequel.migration do
2
+ # Updates the database with the changes specified in the block.
3
+ up do
4
+ Zen.database[:settings].filter(:name => 'website_enabled').delete
5
+ end
6
+
7
+ # Reverts the changes made in the up() block.
8
+ down do
9
+ Zen.database[:settings].insert(
10
+ :name => 'website_enabled', :group => 'general', :default => true, :type => 'radio'
11
+ )
12
+ end
13
+ end
@@ -148,7 +148,6 @@ module Zen
148
148
  def html(markup)
149
149
  return markup
150
150
  end
151
-
152
- end
153
- end
154
- end
151
+ end # Markup
152
+ end # Plugin
153
+ end # Zen
@@ -251,7 +251,7 @@ Zen.Editor = new Class(
251
251
  {
252
252
  if ( current_class.options[attr] !== null )
253
253
  {
254
- element.setStyle(attr, current_class.options[attr]);
254
+ element.setStyle('min-' + attr, current_class.options[attr]);
255
255
  }
256
256
  });
257
257
 
@@ -43,6 +43,7 @@ module Zen
43
43
  #
44
44
  def validate
45
45
  validates_presence([:name, :author, :about, :template_dir])
46
+ validates_format(:name, /[a-z0-9_\-]+/)
46
47
 
47
48
  # Validate all the directories
48
49
  validates_filepath(:template_dir)
@@ -7,5 +7,5 @@ module Zen
7
7
  # @author Yorick Peterse
8
8
  # @since 0.1
9
9
  #
10
- Version = '0.2.6.1'
10
+ Version = '0.2.7'
11
11
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zen
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.6.1
5
+ version: 0.2.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Yorick Peterse
@@ -19,9 +19,9 @@ dependencies:
19
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
- - - ">="
22
+ - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: 3.20.0
24
+ version: 3.24.1
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
- - - ">="
33
+ - - ~>
34
34
  - !ruby/object:Gem::Version
35
35
  version: 2011.01.30
36
36
  type: :runtime
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
- - - ">="
44
+ - - ~>
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.1.4
47
47
  type: :runtime
@@ -52,7 +52,7 @@ dependencies:
52
52
  requirement: &id004 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
- - - ">="
55
+ - - ~>
56
56
  - !ruby/object:Gem::Version
57
57
  version: 0.0.6
58
58
  type: :runtime
@@ -63,7 +63,7 @@ dependencies:
63
63
  requirement: &id005 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
- - - ">="
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.0.4
69
69
  type: :runtime
@@ -74,9 +74,9 @@ dependencies:
74
74
  requirement: &id006 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
- - - ">="
77
+ - - ~>
78
78
  - !ruby/object:Gem::Version
79
- version: 0.8.7
79
+ version: 0.9.2
80
80
  type: :runtime
81
81
  version_requirements: *id006
82
82
  - !ruby/object:Gem::Dependency
@@ -85,7 +85,7 @@ dependencies:
85
85
  requirement: &id007 !ruby/object:Gem::Requirement
86
86
  none: false
87
87
  requirements:
88
- - - ">="
88
+ - - ~>
89
89
  - !ruby/object:Gem::Version
90
90
  version: 1.0.0
91
91
  type: :runtime
@@ -96,7 +96,7 @@ dependencies:
96
96
  requirement: &id008 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - ">="
99
+ - - ~>
100
100
  - !ruby/object:Gem::Version
101
101
  version: 1.6.8
102
102
  type: :development
@@ -107,7 +107,7 @@ dependencies:
107
107
  requirement: &id009 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
- - - ">="
110
+ - - ~>
111
111
  - !ruby/object:Gem::Version
112
112
  version: 4.2.7
113
113
  type: :development
@@ -118,9 +118,9 @@ dependencies:
118
118
  requirement: &id010 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
- - - ">="
121
+ - - ~>
122
122
  - !ruby/object:Gem::Version
123
- version: 2.5.0
123
+ version: 2.6.0
124
124
  type: :development
125
125
  version_requirements: *id010
126
126
  - !ruby/object:Gem::Dependency
@@ -129,9 +129,9 @@ dependencies:
129
129
  requirement: &id011 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
- - - ">="
132
+ - - ~>
133
133
  - !ruby/object:Gem::Version
134
- version: 0.6.5
134
+ version: 0.7.1
135
135
  type: :development
136
136
  version_requirements: *id011
137
137
  - !ruby/object:Gem::Dependency
@@ -140,7 +140,7 @@ dependencies:
140
140
  requirement: &id012 !ruby/object:Gem::Requirement
141
141
  none: false
142
142
  requirements:
143
- - - ">="
143
+ - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: 0.4.1.2
146
146
  type: :development
@@ -151,9 +151,9 @@ dependencies:
151
151
  requirement: &id013 !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements:
154
- - - ">="
154
+ - - ~>
155
155
  - !ruby/object:Gem::Version
156
- version: 0.5.7
156
+ version: 0.6.0
157
157
  type: :development
158
158
  version_requirements: *id013
159
159
  - !ruby/object:Gem::Dependency
@@ -162,7 +162,7 @@ dependencies:
162
162
  requirement: &id014 !ruby/object:Gem::Requirement
163
163
  none: false
164
164
  requirements:
165
- - - ">="
165
+ - - ~>
166
166
  - !ruby/object:Gem::Version
167
167
  version: 1.3.3
168
168
  type: :development
@@ -173,7 +173,7 @@ dependencies:
173
173
  requirement: &id015 !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements:
176
- - - ">="
176
+ - - ~>
177
177
  - !ruby/object:Gem::Version
178
178
  version: 0.9.1
179
179
  type: :development
@@ -184,7 +184,7 @@ dependencies:
184
184
  requirement: &id016 !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
187
- - - ">="
187
+ - - ~>
188
188
  - !ruby/object:Gem::Version
189
189
  version: 0.7.1
190
190
  type: :development
@@ -200,7 +200,6 @@ extensions: []
200
200
  extra_rdoc_files: []
201
201
 
202
202
  files:
203
- - .gems
204
203
  - .travis.yml
205
204
  - AUTHORS
206
205
  - CHANGELOG.md
@@ -347,6 +346,7 @@ files:
347
346
  - lib/zen/package/settings/migrations/1295597111_create_schema.rb
348
347
  - lib/zen/package/settings/migrations/1299538742_add_language_key.rb
349
348
  - lib/zen/package/settings/migrations/1303196915_settings_plugin.rb
349
+ - lib/zen/package/settings/migrations/1307796295_remove_website_enabled.rb
350
350
  - lib/zen/package/users/lib/users/controller/access_rules.rb
351
351
  - lib/zen/package/users/lib/users/controller/user_groups.rb
352
352
  - lib/zen/package/users/lib/users/controller/users.rb
data/.gems DELETED
@@ -1,34 +0,0 @@
1
- bcrypt-ruby -v2.1.4
2
- bundler -v1.0.13
3
- capybara -v0.4.1.2
4
- celerity -v0.8.9
5
- childprocess -v0.1.9
6
- commander -v4.0.4
7
- crack -v0.1.8
8
- culerity -v0.2.15
9
- defensio -v0.9.1
10
- diff-lcs -v1.1.2
11
- ffi -v1.0.9
12
- highline -v1.6.2
13
- httparty -v0.7.7
14
- innate -v2011.04
15
- loofah -v1.0.0
16
- mime-types -v1.16
17
- nokogiri -v1.4.4
18
- rack -v1.2.3
19
- rack-test -v0.6.0
20
- rake -v0.9.0
21
- ramaze -v2011.01.30
22
- rdiscount -v1.6.8
23
- RedCloth -v4.2.7
24
- rspec -v2.6.0
25
- rspec-core -v2.6.3
26
- rspec-expectations -v2.6.0
27
- rspec-mocks -v2.6.0
28
- rubyzip -v0.9.4
29
- selenium-webdriver -v0.2.0
30
- sequel -v3.23.0
31
- sequel_sluggable -v0.0.6
32
- sqlite3 -v1.3.3
33
- xpath -v0.1.4
34
- yard -v0.7.1