comfortable_mexican_sofa 1.4.17 → 1.4.18
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/VERSION +1 -1
- data/comfortable_mexican_sofa.gemspec +1 -1
- data/config/locales/es.yml +25 -25
- data/lib/comfortable_mexican_sofa/fixtures.rb +24 -8
- data/lib/tasks/comfortable_mexican_sofa.rake +2 -5
- data/test/test_helper.rb +5 -0
- metadata +8 -8
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.4.
|
|
1
|
+
1.4.18
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{comfortable_mexican_sofa}
|
|
8
|
-
s.version = "1.4.
|
|
8
|
+
s.version = "1.4.18"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Oleg Khabarov", "The Working Group Inc"]
|
data/config/locales/es.yml
CHANGED
|
@@ -76,12 +76,12 @@ es:
|
|
|
76
76
|
not_found: Revisión no encontrada
|
|
77
77
|
|
|
78
78
|
files:
|
|
79
|
-
created:
|
|
80
|
-
creation_failure:
|
|
81
|
-
updated:
|
|
82
|
-
update_failure:
|
|
83
|
-
deleted:
|
|
84
|
-
not_found:
|
|
79
|
+
created: Archivos subidos
|
|
80
|
+
creation_failure: Fallo la subida del archivo
|
|
81
|
+
updated: Archivo actualizado
|
|
82
|
+
update_failure: Fallo la actualización del archivo
|
|
83
|
+
deleted: Archivo borrado
|
|
84
|
+
not_found: Archivo no encontrado
|
|
85
85
|
|
|
86
86
|
content:
|
|
87
87
|
site_not_found: Sitio no encontrado
|
|
@@ -95,13 +95,13 @@ es:
|
|
|
95
95
|
layouts: Diseños
|
|
96
96
|
pages: Páginas
|
|
97
97
|
snippets: Fragmentos
|
|
98
|
-
files:
|
|
98
|
+
files: Archivos
|
|
99
99
|
|
|
100
100
|
sites:
|
|
101
101
|
index:
|
|
102
102
|
title: Listado de Sitios
|
|
103
103
|
new_link: Crear nuevo Sitio
|
|
104
|
-
select:
|
|
104
|
+
select: Selecciona el Sitio
|
|
105
105
|
edit: Editar
|
|
106
106
|
delete: Eliminar
|
|
107
107
|
are_you_sure: ¿Está seguro de que desea eliminar este sitio?
|
|
@@ -184,30 +184,30 @@ es:
|
|
|
184
184
|
|
|
185
185
|
files:
|
|
186
186
|
index:
|
|
187
|
-
title:
|
|
188
|
-
new_link:
|
|
189
|
-
edit:
|
|
190
|
-
delete:
|
|
191
|
-
are_you_sure:
|
|
187
|
+
title: Archivos
|
|
188
|
+
new_link: Subir Nuevo Archivo
|
|
189
|
+
edit: Editar
|
|
190
|
+
delete: Borrar
|
|
191
|
+
are_you_sure: ¿Estás seguro?
|
|
192
192
|
button: Cargar Archivos
|
|
193
193
|
new:
|
|
194
|
-
title:
|
|
194
|
+
title: Nuevo Archivo
|
|
195
195
|
edit:
|
|
196
|
-
title:
|
|
196
|
+
title: Editar Archivo
|
|
197
197
|
form:
|
|
198
|
-
create:
|
|
199
|
-
update:
|
|
198
|
+
create: Subir Archivo
|
|
199
|
+
update: Actualizar Archivo
|
|
200
200
|
|
|
201
201
|
categories:
|
|
202
202
|
index:
|
|
203
|
-
label:
|
|
204
|
-
edit:
|
|
205
|
-
done:
|
|
206
|
-
all:
|
|
207
|
-
add:
|
|
203
|
+
label: Categorias
|
|
204
|
+
edit: Editar
|
|
205
|
+
done: Listo
|
|
206
|
+
all: Todos
|
|
207
|
+
add: Agregar
|
|
208
208
|
show:
|
|
209
|
-
are_you_sure:
|
|
209
|
+
are_you_sure: ¿Estás seguro?
|
|
210
210
|
edit:
|
|
211
|
-
save:
|
|
211
|
+
save: Guardar
|
|
212
212
|
form:
|
|
213
|
-
label:
|
|
213
|
+
label: Categorias
|
|
@@ -13,8 +13,11 @@ module ComfortableMexicanSofa::Fixtures
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def self.import_layouts(to_hostname, from_hostname = nil, path = nil, root = true, parent = nil, layout_ids = [])
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
site = Cms::Site.find_or_create_by_hostname(to_hostname)
|
|
17
|
+
unless path ||= find_fixtures_path((from_hostname || to_hostname), 'layouts')
|
|
18
|
+
$stderr.puts 'Cannot find fixtures'
|
|
19
|
+
return
|
|
20
|
+
end
|
|
18
21
|
|
|
19
22
|
Dir.glob("#{path}/*").select{|f| File.directory?(f)}.each do |path|
|
|
20
23
|
slug = path.split('/').last
|
|
@@ -62,15 +65,21 @@ module ComfortableMexicanSofa::Fixtures
|
|
|
62
65
|
end
|
|
63
66
|
|
|
64
67
|
# removing all db entries that are not in fixtures
|
|
65
|
-
|
|
68
|
+
if root
|
|
69
|
+
site.layouts.where('id NOT IN (?)', layout_ids.uniq).each{ |l| l.destroy }
|
|
70
|
+
$stdout.puts 'Imported Layouts!'
|
|
71
|
+
end
|
|
66
72
|
|
|
67
73
|
# returning ids of layouts in fixtures
|
|
68
74
|
layout_ids.uniq
|
|
69
75
|
end
|
|
70
76
|
|
|
71
77
|
def self.import_pages(to_hostname, from_hostname = nil, path = nil, root = true, parent = nil, page_ids = [])
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
site = Cms::Site.find_or_create_by_hostname(to_hostname)
|
|
79
|
+
unless path ||= find_fixtures_path((from_hostname || to_hostname), 'pages')
|
|
80
|
+
$stderr.puts 'Cannot find fixtures'
|
|
81
|
+
return
|
|
82
|
+
end
|
|
74
83
|
|
|
75
84
|
Dir.glob("#{path}/*").select{|f| File.directory?(f)}.each do |path|
|
|
76
85
|
slug = path.split('/').last
|
|
@@ -119,15 +128,21 @@ module ComfortableMexicanSofa::Fixtures
|
|
|
119
128
|
end
|
|
120
129
|
|
|
121
130
|
# removing all db entries that are not in fixtures
|
|
122
|
-
|
|
131
|
+
if root
|
|
132
|
+
site.pages.where('id NOT IN (?)', page_ids.uniq).each{ |p| p.destroy }
|
|
133
|
+
$stdout.puts 'Imported Pages!'
|
|
134
|
+
end
|
|
123
135
|
|
|
124
136
|
# returning ids of layouts in fixtures
|
|
125
137
|
page_ids.uniq
|
|
126
138
|
end
|
|
127
139
|
|
|
128
140
|
def self.import_snippets(to_hostname, from_hostname = nil)
|
|
129
|
-
|
|
130
|
-
|
|
141
|
+
site = Cms::Site.find_or_create_by_hostname(to_hostname)
|
|
142
|
+
unless path = find_fixtures_path((from_hostname || to_hostname), 'snippets')
|
|
143
|
+
$stdout.puts 'Cannot find fixtures'
|
|
144
|
+
return
|
|
145
|
+
end
|
|
131
146
|
|
|
132
147
|
snippet_ids = []
|
|
133
148
|
Dir.glob("#{path}/*").select{|f| File.directory?(f)}.each do |path|
|
|
@@ -161,6 +176,7 @@ module ComfortableMexicanSofa::Fixtures
|
|
|
161
176
|
|
|
162
177
|
# removing all db entries that are not in fixtures
|
|
163
178
|
site.snippets.where('id NOT IN (?)', snippet_ids).each{ |s| s.destroy }
|
|
179
|
+
$stdout.puts 'Imported Snippets!'
|
|
164
180
|
end
|
|
165
181
|
|
|
166
182
|
def self.export_layouts(from_hostname, to_hostname = nil)
|
|
@@ -11,10 +11,8 @@ namespace :comfortable_mexican_sofa do
|
|
|
11
11
|
to = ENV['TO'] || ENV['FROM']
|
|
12
12
|
from = ENV['FROM']
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
puts "Importing from Folder [#{from}] to Site [#{to}] ..."
|
|
14
|
+
puts "Importing CMS Fixtures from Folder [#{from}] to Site [#{to}] ..."
|
|
16
15
|
ComfortableMexicanSofa::Fixtures.import_all(to, from)
|
|
17
|
-
puts 'Done!'
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
desc 'Export database data into Fixtures (options: FROM=example.com TO=example.local)'
|
|
@@ -22,8 +20,7 @@ namespace :comfortable_mexican_sofa do
|
|
|
22
20
|
to = ENV['TO'] || ENV['FROM']
|
|
23
21
|
from = ENV['FROM']
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
puts "Exporting from Site [#{from}] to Folder [#{to}] ..."
|
|
23
|
+
puts "Exporting CMS data from Site [#{from}] to Folder [#{to}] ..."
|
|
27
24
|
ComfortableMexicanSofa::Fixtures.export_all(from, to)
|
|
28
25
|
puts 'Done!'
|
|
29
26
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comfortable_mexican_sofa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.18
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -15,7 +15,7 @@ default_executable:
|
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: rails
|
|
18
|
-
requirement: &
|
|
18
|
+
requirement: &70197712792820 !ruby/object:Gem::Requirement
|
|
19
19
|
none: false
|
|
20
20
|
requirements:
|
|
21
21
|
- - ! '>='
|
|
@@ -23,10 +23,10 @@ dependencies:
|
|
|
23
23
|
version: 3.0.0
|
|
24
24
|
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
|
-
version_requirements: *
|
|
26
|
+
version_requirements: *70197712792820
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: active_link_to
|
|
29
|
-
requirement: &
|
|
29
|
+
requirement: &70197712791920 !ruby/object:Gem::Requirement
|
|
30
30
|
none: false
|
|
31
31
|
requirements:
|
|
32
32
|
- - ! '>='
|
|
@@ -34,10 +34,10 @@ dependencies:
|
|
|
34
34
|
version: 1.0.0
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
|
-
version_requirements: *
|
|
37
|
+
version_requirements: *70197712791920
|
|
38
38
|
- !ruby/object:Gem::Dependency
|
|
39
39
|
name: paperclip
|
|
40
|
-
requirement: &
|
|
40
|
+
requirement: &70197712791440 !ruby/object:Gem::Requirement
|
|
41
41
|
none: false
|
|
42
42
|
requirements:
|
|
43
43
|
- - ! '>='
|
|
@@ -45,7 +45,7 @@ dependencies:
|
|
|
45
45
|
version: 2.3.14
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
|
-
version_requirements: *
|
|
48
|
+
version_requirements: *70197712791440
|
|
49
49
|
description: ''
|
|
50
50
|
email: oleg@theworkinggroup.ca
|
|
51
51
|
executables: []
|
|
@@ -349,7 +349,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
349
349
|
version: '0'
|
|
350
350
|
segments:
|
|
351
351
|
- 0
|
|
352
|
-
hash:
|
|
352
|
+
hash: 1469996073004586426
|
|
353
353
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
354
|
none: false
|
|
355
355
|
requirements:
|