comfortable_mexican_loveseat 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95e4eab6ee77cb6d89e436a1ce877fbdc7a9155d
4
- data.tar.gz: cb7eaba78865182342da75cc1043724550038dd6
3
+ metadata.gz: 27d0a4bac0a977c66e5aa22c363aa6fdd958c4ec
4
+ data.tar.gz: 38fae3cfe5032275b126efb6cab686858a73cd5a
5
5
  SHA512:
6
- metadata.gz: bc98292d85c6a8bc322d9780fd7cd7334d3e3c4cbaba7f3454f4327e2c587ceef29078dc7e52667c14354366019aff57f2d90989dc8488f1157b3f047192b118
7
- data.tar.gz: 61d14a343c3ca87083767dd042916ef7893ac809faa058203020f5a7dad53c9b702a80cfe37be7215ea232dc7d8bfbb2f836eb0967bce4a763a44c7a689bf7b0
6
+ metadata.gz: 3b280aef77fd7f3c3be5dc8762df3f221ffb566506ff96ec3cf293247c6f61e64465b566b43fe66735ed1710e3e8c1f5325e951c534c7eba626859d21dec2437
7
+ data.tar.gz: f6836fc06902bd9de166ea01cab2ca392429422388a62bd5556bf68a22bf227254224fa80804a86fba2304f42b9eeeccb5b3c84025b55daad430bbac05ce2c2f
data/README.rdoc CHANGED
@@ -6,6 +6,18 @@ The Loveseat references a fixed version of the CMS (currently 1.12.8) and latest
6
6
 
7
7
  == SEO Features
8
8
 
9
+ === Simplified Fixture Import/Export
10
+
11
+ When you want to import fixtures you can now use the following commands:
12
+
13
+ rake cms:import # imports from all folders and automatically creates matching sites if they don't exist
14
+ rake cms:import FROM=somewhere # automatically imports to somewhere
15
+ rake cms:import FROM=somewhere TO=something LOCALE=de #lets you set the locale for the site
16
+
17
+ rake cms:export
18
+ rake cms:export FROM=somewhere
19
+ rake cms:export FROM=somewhere TO=something LOCALE=de
20
+
9
21
  === Custom Sitemaps
10
22
 
11
23
  Building on the Sofa's sitemap functionality, the Loveseat lets you add Rails model show pages and custom routes to the sitemap.
data/Rakefile CHANGED
@@ -14,11 +14,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
-
18
-
19
-
20
-
21
-
22
17
  Bundler::GemHelper.install_tasks
23
18
 
24
19
  require 'rake/testtask'
@@ -0,0 +1,8 @@
1
+ module ComfortableMexicanLoveseat::Fixture
2
+ class Importer < ComfortableMexicanSofa::Fixture::Importer
3
+ def initialize(from, to = from, force_import = false, locale = I18n.default_locale)
4
+ super(from, to, force_import)
5
+ self.site = Comfy::Cms::Site.find_or_create_by(:identifier => to, :locale => locale)
6
+ end
7
+ end
8
+ end
@@ -1,6 +1,7 @@
1
1
  require 'comfortable_mexican_sofa'
2
2
  require 'rack-rewrite'
3
3
  require 'comfortable_mexican_loveseat/engine'
4
+ require 'comfortable_mexican_loveseat/fixture'
4
5
 
5
6
  module ComfortableMexicanLoveseat
6
7
  mattr_accessor :seo_custom_paths
@@ -0,0 +1,68 @@
1
+ namespace :comfortable_mexican_loveseat do
2
+ namespace :fixtures do
3
+
4
+ desc 'Import Fixture data into database (options: FROM=folder_name TO=site_identifier)'
5
+ task :import => :environment do
6
+ from = ENV['FROM']
7
+ to = ENV['TO'] || ENV['FROM']
8
+ locale = ENV['LOCALE']
9
+
10
+ if from
11
+ puts "Importing CMS Fixtures from Folder [#{from}] to Site [#{to}] ..."
12
+ else
13
+ puts "Importing all CMS Fixtures ..."
14
+ end
15
+
16
+ # changing so that logger is going straight to screen
17
+ logger = ComfortableMexicanSofa.logger
18
+ ComfortableMexicanSofa.logger = Logger.new(STDOUT)
19
+
20
+ if from
21
+ ComfortableMexicanLoveseat::Fixture::Importer.new(from, to, :force).import!
22
+ else
23
+ Dir["#{Rails.root}/db/cms_fixtures/*"].map { |dir| Pathname.new(dir).basename.to_s }.each do |from|
24
+ next if from == 'sample-site'
25
+ to ||= from
26
+
27
+ puts "Importing Fixtures from #{from} to #{to}"
28
+ ComfortableMexicanLoveseat::Fixture::Importer.new(from, to, :force).import!
29
+ end
30
+ end
31
+
32
+ ComfortableMexicanSofa.logger = logger
33
+ end
34
+
35
+ desc 'Export database data into Fixtures (options: FROM=site_identifier TO=folder_name)'
36
+ task :export => :environment do
37
+ from = ENV['FROM']
38
+ to = ENV['TO'] || ENV['FROM']
39
+
40
+ if from
41
+ puts "Exporting CMS data from Site [#{from}] to Folder [#{to}] ..."
42
+ else
43
+ puts "Exporting all CMS data ..."
44
+ end
45
+
46
+ # changing so that logger is going straight to screen
47
+ logger = ComfortableMexicanSofa.logger
48
+ ComfortableMexicanSofa.logger = Logger.new(STDOUT)
49
+
50
+ if from
51
+ ComfortableMexicanSofa::Fixture::Exporter.new(from, to).export!
52
+ else
53
+ Comfy::Cms::Site.pluck(:identifier).each do |from|
54
+ to ||= from
55
+ puts "Exporting Fixtures from #{from} to #{to}"
56
+ ComfortableMexicanSofa::Fixture::Exporter.new(from, to).export!
57
+ end
58
+ end
59
+
60
+ ComfortableMexicanSofa.logger = logger
61
+ end
62
+ end
63
+ end
64
+
65
+ namespace :cms do
66
+ task import: 'comfortable_mexican_loveseat:fixtures:import'
67
+ task export: 'comfortable_mexican_loveseat:fixtures:export'
68
+ end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_loveseat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bahlke
8
+ - Michael Rüffer
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-08-10 00:00:00.000000000 Z
12
+ date: 2015-08-12 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
@@ -88,6 +89,8 @@ files:
88
89
  - app/views/layouts/comfy/admin/cms/_flash.html.haml
89
90
  - lib/comfortable_mexican_loveseat.rb
90
91
  - lib/comfortable_mexican_loveseat/engine.rb
92
+ - lib/comfortable_mexican_loveseat/fixture.rb
93
+ - lib/tasks/comfortable_mexican_loveseat.rake
91
94
  - test/comfortable_mexican_loveseat_test.rb
92
95
  - test/dummy/README.rdoc
93
96
  - test/dummy/Rakefile