padrino-admin 0.9.25 → 0.9.26
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.
|
@@ -43,7 +43,9 @@ module Padrino
|
|
|
43
43
|
say "<= Your are using '#{tmp_ext}' and for admin we only support '#{supported_ext.join(', ')}'. Please use -e haml or -e erb or -e slim", :yellow
|
|
44
44
|
raise SystemExit
|
|
45
45
|
end
|
|
46
|
+
|
|
46
47
|
store_component_choice(:admin_renderer, tmp_ext)
|
|
48
|
+
@session_secret = fetch_component_choice(:session_secret)
|
|
47
49
|
|
|
48
50
|
self.behavior = :revoke if options[:destroy]
|
|
49
51
|
|
|
@@ -16,7 +16,7 @@ class Admin < Padrino::Application
|
|
|
16
16
|
# disable :flash # Disables rack-flash (enabled by default if sessions)
|
|
17
17
|
# layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
|
|
18
18
|
#
|
|
19
|
-
set :session_secret, "<%=
|
|
19
|
+
set :session_secret, "<%= @session_secret %>"
|
|
20
20
|
set :login_page, "/admin/sessions/new"
|
|
21
21
|
disable :store_location
|
|
22
22
|
|
data/padrino-admin.gemspec
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
1
2
|
require File.expand_path("../../padrino-core/lib/padrino-core/version.rb", __FILE__)
|
|
2
3
|
|
|
3
4
|
Gem::Specification.new do |s|
|
|
@@ -11,10 +12,14 @@ Gem::Specification.new do |s|
|
|
|
11
12
|
s.required_rubygems_version = ">= 1.3.6"
|
|
12
13
|
s.version = Padrino.version
|
|
13
14
|
s.date = Time.now.strftime("%Y-%m-%d")
|
|
15
|
+
|
|
14
16
|
s.extra_rdoc_files = Dir["*.rdoc"]
|
|
15
|
-
s.files
|
|
16
|
-
s.
|
|
17
|
-
s.
|
|
17
|
+
s.files = `git ls-files`.split("\n")
|
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
|
+
s.require_paths = ["lib"]
|
|
21
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
|
22
|
+
|
|
18
23
|
s.add_dependency("padrino-core", Padrino.version)
|
|
19
24
|
s.add_dependency("padrino-helpers", Padrino.version)
|
|
20
25
|
end
|
|
@@ -56,6 +56,16 @@ class TestAdminPageGenerator < Test::Unit::TestCase
|
|
|
56
56
|
assert_match_in_file "check_box_tag :bypass", "#{@apptmp}/sample_project/admin/views/sessions/new.haml"
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
should "store and apply session_secret" do
|
|
60
|
+
silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}", '-d=datamapper','-e=haml') }
|
|
61
|
+
silence_logger { generate(:admin_app, "--root=#{@apptmp}/sample_project") }
|
|
62
|
+
assert_match_in_file(/session_secret:.+/, "#{@apptmp}/sample_project/.components")
|
|
63
|
+
session_secret = YAML.load_file("#{@apptmp}/sample_project/.components")[:session_secret]
|
|
64
|
+
assert_not_equal "", session_secret
|
|
65
|
+
assert_match_in_file(/#{session_secret}/, "#{@apptmp}/sample_project/app/app.rb")
|
|
66
|
+
assert_match_in_file(/#{session_secret}/, "#{@apptmp}/sample_project/admin/app.rb")
|
|
67
|
+
end
|
|
68
|
+
|
|
59
69
|
should 'correctly generate a new padrino admin application with erb renderer' do
|
|
60
70
|
silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}", '-d=datamapper', '-e=erb') }
|
|
61
71
|
silence_logger { generate(:admin_app, "--root=#{@apptmp}/sample_project") }
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: padrino-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 15
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
|
-
-
|
|
10
|
-
version: 0.9.
|
|
9
|
+
- 26
|
|
10
|
+
version: 0.9.26
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Padrino Team
|
|
@@ -18,8 +18,7 @@ autorequire:
|
|
|
18
18
|
bindir: bin
|
|
19
19
|
cert_chain: []
|
|
20
20
|
|
|
21
|
-
date: 2011-04-
|
|
22
|
-
default_executable:
|
|
21
|
+
date: 2011-04-28 00:00:00 Z
|
|
23
22
|
dependencies:
|
|
24
23
|
- !ruby/object:Gem::Dependency
|
|
25
24
|
name: padrino-core
|
|
@@ -29,12 +28,12 @@ dependencies:
|
|
|
29
28
|
requirements:
|
|
30
29
|
- - "="
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
|
-
hash:
|
|
31
|
+
hash: 15
|
|
33
32
|
segments:
|
|
34
33
|
- 0
|
|
35
34
|
- 9
|
|
36
|
-
-
|
|
37
|
-
version: 0.9.
|
|
35
|
+
- 26
|
|
36
|
+
version: 0.9.26
|
|
38
37
|
type: :runtime
|
|
39
38
|
version_requirements: *id001
|
|
40
39
|
- !ruby/object:Gem::Dependency
|
|
@@ -45,12 +44,12 @@ dependencies:
|
|
|
45
44
|
requirements:
|
|
46
45
|
- - "="
|
|
47
46
|
- !ruby/object:Gem::Version
|
|
48
|
-
hash:
|
|
47
|
+
hash: 15
|
|
49
48
|
segments:
|
|
50
49
|
- 0
|
|
51
50
|
- 9
|
|
52
|
-
-
|
|
53
|
-
version: 0.9.
|
|
51
|
+
- 26
|
|
52
|
+
version: 0.9.26
|
|
54
53
|
type: :runtime
|
|
55
54
|
version_requirements: *id002
|
|
56
55
|
description: Admin View for Padrino applications
|
|
@@ -67,7 +66,7 @@ files:
|
|
|
67
66
|
- LICENSE
|
|
68
67
|
- README.rdoc
|
|
69
68
|
- Rakefile
|
|
70
|
-
- padrino-admin.
|
|
69
|
+
- lib/padrino-admin.rb
|
|
71
70
|
- lib/padrino-admin/access_control.rb
|
|
72
71
|
- lib/padrino-admin/generators/actions.rb
|
|
73
72
|
- lib/padrino-admin/generators/admin_app.rb
|
|
@@ -80,13 +79,13 @@ files:
|
|
|
80
79
|
- lib/padrino-admin/generators/templates/account/mongomapper.rb.tt
|
|
81
80
|
- lib/padrino-admin/generators/templates/account/seeds.rb.tt
|
|
82
81
|
- lib/padrino-admin/generators/templates/account/sequel.rb.tt
|
|
82
|
+
- lib/padrino-admin/generators/templates/app.rb.tt
|
|
83
83
|
- lib/padrino-admin/generators/templates/app/controllers/base.rb
|
|
84
84
|
- lib/padrino-admin/generators/templates/app/controllers/sessions.rb
|
|
85
|
-
- lib/padrino-admin/generators/templates/app.rb.tt
|
|
86
85
|
- lib/padrino-admin/generators/templates/assets/stylesheets/base.css
|
|
87
86
|
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/amro/style.css
|
|
88
|
-
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec/style.css
|
|
89
87
|
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec-green/style.css
|
|
88
|
+
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec/style.css
|
|
90
89
|
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/blue/style.css
|
|
91
90
|
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/default/style.css
|
|
92
91
|
- lib/padrino-admin/generators/templates/assets/stylesheets/themes/djime-cerulean/style.css
|
|
@@ -158,13 +157,12 @@ files:
|
|
|
158
157
|
- lib/padrino-admin/locale/orm/zh_cn.yml
|
|
159
158
|
- lib/padrino-admin/locale/orm/zh_tw.yml
|
|
160
159
|
- lib/padrino-admin/utils/crypt.rb
|
|
161
|
-
-
|
|
160
|
+
- padrino-admin.gemspec
|
|
162
161
|
- test/fixtures/data_mapper.rb
|
|
163
162
|
- test/generators/test_admin_app_generator.rb
|
|
164
163
|
- test/generators/test_admin_page_generator.rb
|
|
165
164
|
- test/helper.rb
|
|
166
165
|
- test/test_admin_application.rb
|
|
167
|
-
has_rdoc: true
|
|
168
166
|
homepage: http://www.padrinorb.com
|
|
169
167
|
licenses: []
|
|
170
168
|
|
|
@@ -196,9 +194,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
196
194
|
requirements: []
|
|
197
195
|
|
|
198
196
|
rubyforge_project: padrino-admin
|
|
199
|
-
rubygems_version: 1.
|
|
197
|
+
rubygems_version: 1.7.2
|
|
200
198
|
signing_key:
|
|
201
199
|
specification_version: 3
|
|
202
200
|
summary: Admin Dashboard for Padrino
|
|
203
|
-
test_files:
|
|
204
|
-
|
|
201
|
+
test_files:
|
|
202
|
+
- test/fixtures/data_mapper.rb
|
|
203
|
+
- test/generators/test_admin_app_generator.rb
|
|
204
|
+
- test/generators/test_admin_page_generator.rb
|
|
205
|
+
- test/helper.rb
|
|
206
|
+
- test/test_admin_application.rb
|