radiant-exporter-extension 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,9 +6,9 @@ end
|
|
6
6
|
module Radiant
|
7
7
|
class Exporter
|
8
8
|
cattr_accessor :exportable_models
|
9
|
-
@@exportable_models = [Radiant::Config, User, Page, PagePart, PageField,
|
9
|
+
@@exportable_models = [Radiant::Config, User, Page, PagePart, PageField, Layout]
|
10
10
|
cattr_accessor :template_models
|
11
|
-
@@template_models = [Layout,
|
11
|
+
@@template_models = [Layout, Page, PagePart, PageField]
|
12
12
|
cattr_accessor :ignored_template_attributes
|
13
13
|
@@ignored_template_attributes = [:lock_version, :created_at, :updated_at, :created_by_id, :updated_by_id]
|
14
14
|
|
data/exporter_extension.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
Feature: Exporting yaml
|
2
|
+
In order to collect data
|
3
|
+
As a user
|
4
|
+
I should be able to export YAML
|
5
|
+
|
6
|
+
Scenario Outline: Anyone can export YAML
|
7
|
+
Given I am logged in as "<username>"
|
8
|
+
When I go to the export page
|
9
|
+
Then I should see "id:"
|
10
|
+
|
11
|
+
Examples:
|
12
|
+
| username |
|
13
|
+
| admin |
|
14
|
+
| existing |
|
15
|
+
| another |
|
16
|
+
| designer |
|
data/features/support/paths.rb
CHANGED
@@ -1,14 +1,22 @@
|
|
1
|
-
|
2
|
-
case page_name
|
1
|
+
module NavigationHelpers
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
# Extend the standard PathMatchers with your own paths
|
4
|
+
# to be used in your features.
|
5
|
+
#
|
6
|
+
# The keys and values here may be used in your standard web steps
|
7
|
+
# Using:
|
8
|
+
#
|
9
|
+
# When I go to the "snippets" admin page
|
10
|
+
#
|
11
|
+
# would direct the request to the path you provide in the value:
|
12
|
+
#
|
13
|
+
# admin_snippets_path
|
14
|
+
#
|
15
|
+
PathMatchers = {} unless defined?(PathMatchers)
|
16
|
+
PathMatchers.merge!({
|
17
|
+
/export/i => 'export_path'
|
18
|
+
})
|
6
19
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
else
|
12
|
-
raise "Can't find mapping from \"#{page_name}\" to a path."
|
13
|
-
end
|
14
|
-
end
|
20
|
+
end
|
21
|
+
|
22
|
+
World(NavigationHelpers)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.expand_path("../../../spec_helper", __FILE__)
|
2
2
|
|
3
3
|
describe Radiant::Exporter do
|
4
|
-
dataset :pages_with_layouts, :users_and_pages
|
4
|
+
dataset :pages_with_layouts, :users_and_pages
|
5
5
|
|
6
6
|
let(:exporter){ Radiant::Exporter }
|
7
7
|
let(:exported_content){ exporter.export }
|
@@ -19,8 +19,8 @@ describe Radiant::Exporter do
|
|
19
19
|
exported_hash['Users'][user_id(:admin)]['name'].should == users(:admin).name
|
20
20
|
end
|
21
21
|
|
22
|
-
its(:exportable_models){ should == [Radiant::Config, User, Page, PagePart, PageField,
|
23
|
-
its(:template_models){ should == [Layout,
|
22
|
+
its(:exportable_models){ should == [Radiant::Config, User, Page, PagePart, PageField, Layout] }
|
23
|
+
its(:template_models){ should == [Layout, Page, PagePart, PageField] }
|
24
24
|
its(:ignored_template_attributes){ should == [:lock_version, :created_at, :updated_at, :created_by_id, :updated_by_id] }
|
25
25
|
it "should allow setting exportable_models" do
|
26
26
|
exporter.exportable_models = [Page]
|
metadata
CHANGED
@@ -1,40 +1,30 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-exporter-extension
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 1.0.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Radiant CMS Dev Team
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-01-25 00:00:00 -06:00
|
19
|
-
default_executable:
|
12
|
+
date: 2012-03-05 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
14
|
description: Export your models from Radiant
|
23
|
-
email:
|
15
|
+
email:
|
24
16
|
- radiant@radiantcms.org
|
25
17
|
executables: []
|
26
|
-
|
27
18
|
extensions: []
|
28
|
-
|
29
19
|
extra_rdoc_files: []
|
30
|
-
|
31
|
-
files:
|
20
|
+
files:
|
32
21
|
- app/controllers/admin/export_controller.rb
|
33
22
|
- app/models/radiant/exporter.rb
|
34
23
|
- config/locales/en.yml
|
35
24
|
- config/routes.rb
|
36
25
|
- cucumber.yml
|
37
26
|
- exporter_extension.rb
|
27
|
+
- features/admin/export.feature
|
38
28
|
- features/support/env.rb
|
39
29
|
- features/support/paths.rb
|
40
30
|
- lib/radiant-exporter-extension/version.rb
|
@@ -49,46 +39,37 @@ files:
|
|
49
39
|
- spec/models/radiant/exporter_spec.rb
|
50
40
|
- spec/spec.opts
|
51
41
|
- spec/spec_helper.rb
|
52
|
-
has_rdoc: true
|
53
42
|
homepage: http://radiantcms.org/
|
54
43
|
licenses: []
|
55
|
-
|
56
44
|
post_install_message:
|
57
45
|
rdoc_options: []
|
58
|
-
|
59
|
-
require_paths:
|
46
|
+
require_paths:
|
60
47
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
49
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
67
|
-
|
68
|
-
- 0
|
69
|
-
version: "0"
|
70
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
55
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
segments:
|
77
|
-
- 0
|
78
|
-
version: "0"
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
79
60
|
requirements: []
|
80
|
-
|
81
61
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.8.11
|
83
63
|
signing_key:
|
84
64
|
specification_version: 3
|
85
65
|
summary: Export your models from Radiant
|
86
|
-
test_files:
|
66
|
+
test_files:
|
87
67
|
- spec/ci/before_script
|
88
68
|
- spec/ci/script
|
89
69
|
- spec/controllers/admin/export_controller_spec.rb
|
90
70
|
- spec/models/radiant/exporter_spec.rb
|
91
71
|
- spec/spec.opts
|
92
72
|
- spec/spec_helper.rb
|
73
|
+
- features/admin/export.feature
|
93
74
|
- features/support/env.rb
|
94
75
|
- features/support/paths.rb
|