wagn 1.14.0.pre3 → 1.14.0

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.
Files changed (73) hide show
  1. checksums.yaml +8 -8
  2. data/VERSION +1 -1
  3. data/app/controllers/card_controller.rb +3 -0
  4. data/config/version_cards.txt +1 -1
  5. data/db/bootstrap/card_actions.yml +1072 -1016
  6. data/db/bootstrap/card_acts.yml +2 -2
  7. data/db/bootstrap/card_changes.yml +1740 -1643
  8. data/db/bootstrap/card_references.yml +498 -477
  9. data/db/bootstrap/cards.yml +1179 -1047
  10. data/db/{migrate_cards → migrate_core_cards}/20130411191151_renaming_for_menu.rb +1 -1
  11. data/db/{migrate_cards → migrate_core_cards}/20130411211600_delete_old_related_tab_cards.rb +1 -1
  12. data/db/{migrate_cards → migrate_core_cards}/20130419215612_import_help_text.rb +3 -3
  13. data/db/{migrate_cards → migrate_core_cards}/20130823192433_add_style_cards.rb +1 -1
  14. data/db/{migrate_cards → migrate_core_cards}/20130910183318_move_styles_to_content.rb +2 -2
  15. data/db/{migrate_cards → migrate_core_cards}/20130920214038_jsonize_tinymce.rb +1 -1
  16. data/db/{migrate_cards → migrate_core_cards}/20130920291703_update_stylesheets.rb +2 -2
  17. data/db/{migrate_cards → migrate_core_cards}/20130927191728_account_events.rb +1 -1
  18. data/db/{migrate_cards → migrate_core_cards}/20131016172445_common_css_patch.rb +2 -2
  19. data/db/{migrate_cards → migrate_core_cards}/20140110193325_reset_account_request_type.rb +1 -1
  20. data/db/{migrate_cards → migrate_core_cards}/20140307231621_user_data_to_cards.rb +1 -1
  21. data/db/{migrate_cards → migrate_core_cards}/20140317035504_account_requests_to_signups.rb +1 -1
  22. data/db/{migrate_cards → migrate_core_cards}/20140512155840_add_script_cards.rb +1 -1
  23. data/db/{migrate_cards → migrate_core_cards}/20140629222005_add_email_cards.rb +5 -5
  24. data/db/migrate_core_cards/20140725180118_config_card_updates.rb +9 -0
  25. data/db/migrate_core_cards/20141111083921_delete_machine_output.rb +9 -0
  26. data/db/migrate_core_cards/20141115034214_config_descriptions_etc.rb +14 -0
  27. data/db/{migrate_cards → migrate_core_cards}/data/1.11_help_text.json +0 -0
  28. data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/classic_cards.scss +0 -0
  29. data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/common.scss +0 -0
  30. data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/right_sidebar.scss +0 -0
  31. data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/traditional.scss +0 -0
  32. data/db/{migrate_cards → migrate_core_cards}/data/1.13_config_text.json +1 -1
  33. data/db/migrate_core_cards/data/1.14_config_descriptions_etc.json +77 -0
  34. data/db/{migrate_cards → migrate_core_cards}/data/mailer/follower_notification_email.html +1 -1
  35. data/db/{migrate_cards → migrate_core_cards}/data/mailer/follower_notification_email.txt +0 -0
  36. data/db/{migrate_cards → migrate_core_cards}/data/mailer/mail_config.json +0 -0
  37. data/db/{migrate_cards → migrate_core_cards}/data/mailer/password_reset_email.html +0 -0
  38. data/db/{migrate_cards → migrate_core_cards}/data/mailer/password_reset_email.txt +0 -0
  39. data/db/{migrate_cards → migrate_core_cards}/data/mailer/signup_alert_email.html +0 -0
  40. data/db/{migrate_cards → migrate_core_cards}/data/mailer/signup_alert_email.txt +0 -0
  41. data/db/{migrate_cards → migrate_core_cards}/data/mailer/verification_email.html +0 -0
  42. data/db/{migrate_cards → migrate_core_cards}/data/mailer/verification_email.txt +0 -0
  43. data/db/schema.rb +6 -0
  44. data/features/conflict.feature +3 -3
  45. data/features/watch.feature +1 -1
  46. data/lib/card/act.rb +1 -1
  47. data/lib/card/generators/card_migration/card_migration_generator.rb +1 -0
  48. data/lib/card/generators/card_migration/templates/card_migration.erb +5 -4
  49. data/lib/wagn/application.rb +1 -1
  50. data/lib/wagn/commands.rb +1 -1
  51. data/lib/wagn/core_migration.rb +19 -0
  52. data/lib/wagn/migration.rb +33 -11
  53. data/lib/wagn/tasks/wagn.rake +24 -16
  54. data/lib/wagn/version.rb +4 -3
  55. data/mod/01_core/set/all/content.rb +17 -0
  56. data/mod/02_basic_types/set/type/pointer.rb +8 -6
  57. data/mod/05_standard/set/all/base.rb +3 -1
  58. data/mod/05_standard/set/all/rich_html.rb +28 -12
  59. data/mod/05_standard/set/type/signup.rb +1 -1
  60. data/mod/05_standard/spec/set/type/email_template_spec.rb +3 -1
  61. data/mod/06_email/set/right/bcc.rb +9 -1
  62. data/mod/06_email/set/right/cc.rb +2 -1
  63. data/mod/06_email/set/right/from.rb +2 -1
  64. data/mod/06_email/set/right/to.rb +1 -0
  65. data/test/1.10.0-data-dump.sql +32 -0
  66. data/test/fixtures/card_actions.yml +1565 -1509
  67. data/test/fixtures/card_acts.yml +283 -283
  68. data/test/fixtures/card_changes.yml +3808 -3718
  69. data/test/fixtures/card_references.yml +763 -735
  70. data/test/fixtures/cards.yml +1931 -1806
  71. data/wagn.gemspec +1 -1
  72. metadata +40 -36
  73. data/db/migrate_cards/20140725180118_config_card_updates.rb +0 -9
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class RenamingForMenu < Wagn::Migration
3
+ class RenamingForMenu < Wagn::CoreMigration
4
4
  def up
5
5
  renames = {
6
6
  '*content' => '*structure',
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class DeleteOldRelatedTabCards < Wagn::Migration
3
+ class DeleteOldRelatedTabCards < Wagn::CoreMigration
4
4
  def up
5
5
  [
6
6
  '*related',
@@ -1,9 +1,9 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class ImportHelpText < Wagn::Migration
3
+ class ImportHelpText < Wagn::CoreMigration
4
4
  def up
5
- json = File.read( File.join Wagn.gem_root, 'db/migrate_cards/data/1.11_help_text.json' )
6
- data = JSON.parse json
5
+ dir = data_path '1.11_help_text.json'
6
+ data = JSON.parse( File.read dir )
7
7
  data.each do |atom|
8
8
  c = atom['card']
9
9
  Card.merge c['name'], { :type=>c['type'], :content=>atom['views'][0]['parts'] }, :pristine=>true
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class AddStyleCards < Wagn::Migration
3
+ class AddStyleCards < Wagn::CoreMigration
4
4
  def up
5
5
  # TAKE "CSS" CODENAME FROM OLD *CSS CARD
6
6
  old_css = Card[:css]
@@ -1,8 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class MoveStylesToContent < Wagn::Migration
3
+ class MoveStylesToContent < Wagn::CoreMigration
4
4
  def up
5
- dir = "#{Wagn.gem_root}/db/migrate_cards/data/1.12_stylesheets"
5
+ dir = File.join data_path, "1.12_stylesheets"
6
6
  %w{ right_sidebar common classic_cards traditional }.each do |sheetname|
7
7
  Card["style: #{sheetname}"].update_attributes! :codename=>nil, :content=>File.read("#{dir}/#{sheetname}.scss")
8
8
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class JsonizeTinymce < Wagn::Migration
3
+ class JsonizeTinymce < Wagn::CoreMigration
4
4
  def up
5
5
  card = Card[:tiny_mce]
6
6
  cleaned_rows = card.content.strip.split( /\s*\,\s+/ ).map do |row|
@@ -1,8 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class UpdateStylesheets < Wagn::Migration
3
+ class UpdateStylesheets < Wagn::CoreMigration
4
4
  def up
5
- dir = "#{Wagn.gem_root}/db/migrate_cards/data/1.12_stylesheets"
5
+ dir = File.join data_path, '1.12_stylesheets'
6
6
  %w{ common traditional }.each do |sheetname|
7
7
  card = Card["style: #{sheetname}"]
8
8
  if card && card.pristine?
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class AccountEvents < Wagn::Migration
3
+ class AccountEvents < Wagn::CoreMigration
4
4
  def up
5
5
  aa = Card.fetch "#{ Card[ :signup ].name }+#{ Card[ :type ].name}+#{ Card[:accountable ].name}", :new=>{}
6
6
  aa.content = "1"
@@ -1,8 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class CommonCssPatch < Wagn::Migration
3
+ class CommonCssPatch < Wagn::CoreMigration
4
4
  def up
5
- dir = "#{Wagn.gem_root}/db/migrate_cards/data/1.12_stylesheets"
5
+ dir = File.join data_path, "1.12_stylesheets"
6
6
  card = Card["style: common"]
7
7
  if card && card.pristine?
8
8
  card.update_attributes! :content=>File.read("#{dir}/common.scss")
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class ResetAccountRequestType < Wagn::Migration
3
+ class ResetAccountRequestType < Wagn::CoreMigration
4
4
  def up
5
5
  arcard = Card[:signup]
6
6
  if arcard.type_code != :cardtype
@@ -3,7 +3,7 @@
3
3
  class User < ActiveRecord::Base
4
4
  end
5
5
 
6
- class UserDataToCards < Wagn::Migration
6
+ class UserDataToCards < Wagn::CoreMigration
7
7
 
8
8
  def up
9
9
 
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class AccountRequestsToSignups < Wagn::Migration
3
+ class AccountRequestsToSignups < Wagn::CoreMigration
4
4
  def up
5
5
 
6
6
  newname = 'Sign up'
@@ -20,7 +20,7 @@ class Card
20
20
  end
21
21
  end
22
22
 
23
- class AddScriptCards < Wagn::Migration
23
+ class AddScriptCards < Wagn::CoreMigration
24
24
  def up
25
25
  # JavaScript and CoffeeScript types
26
26
  card = Card.fetch "CoffeeScript", :new => {}
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class AddEmailCards < Wagn::Migration
3
+ class AddEmailCards < Wagn::CoreMigration
4
4
  def up
5
5
 
6
6
  # change notification rules
@@ -38,7 +38,7 @@ class AddEmailCards < Wagn::Migration
38
38
  {{+*subject | titled}}
39
39
  {{+*html message | titled}}
40
40
  {{+*text message | titled}}
41
- {+*attach | titled}}
41
+ {{+*attach | titled}}
42
42
  )
43
43
 
44
44
  c = Card.fetch '*message', :new=>{ }
@@ -54,8 +54,8 @@ class AddEmailCards < Wagn::Migration
54
54
 
55
55
 
56
56
  # create system email cards
57
- dir = "#{Wagn.gem_root}/db/migrate_cards/data/mailer"
58
- json = File.read( File.join( dir, 'mail_config.json' ))
57
+ dir = File.join data_path, 'mailer'
58
+ json = File.read( File.join( dir, 'mail_config.json' ) )
59
59
  data = JSON.parse(json)
60
60
  data.each do |mail|
61
61
  mail = mail.symbolize_keys!
@@ -124,7 +124,7 @@ class AddEmailCards < Wagn::Migration
124
124
  # move old send rule to on_create
125
125
  #fields = %w( to from cc bcc subject message attach )
126
126
  Card.search(:right=>"*send").each do |send_rule|
127
- Card.create! :name=>"#{send_rule.left}+*on create", :content=>send_rule.content, :type_code=>:pointer
127
+ Card.create! :name=>"#{send_rule.left_name}+*on create", :content=>send_rule.content, :type_code=>:pointer
128
128
  send_rule.delete #@ethn: keep old rule for safety reasons?
129
129
  end
130
130
 
@@ -0,0 +1,9 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class ConfigCardUpdates < Wagn::CoreMigration
4
+ def up
5
+ raw_json = File.read( data_path '1.13_config_text.json' )
6
+ json = JSON.parse raw_json
7
+ Card.merge_list json["card"]["value"], :output_file=>"tmp/unmerged_config_text.json"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class DeleteMachineOutput < Wagn::CoreMigration
4
+ def up
5
+ Card.search( :right => { :codename => 'machine_output' } ).each do |card|
6
+ card.delete!
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,14 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class ConfigDescriptionsEtc < Wagn::CoreMigration
4
+ def up
5
+ raw_json = File.read( data_path '1.14_config_descriptions_etc.json' )
6
+ json = JSON.parse raw_json
7
+ Card.merge_list json["card"]["value"], :output_file=>"tmp/unmerged_config_text.json"
8
+
9
+ # fix missing +*from card
10
+ c = Card.fetch "follower notification email+#{Card[:from].name}", :new=>{}
11
+ c.content = Card[:wagn_bot].name
12
+ c.save!
13
+ end
14
+ end
@@ -14,7 +14,7 @@
14
14
  {
15
15
  "name": "Sign up+description",
16
16
  "type": "Basic",
17
- "content": "<p>[[Sign up]] cards represent not-yet-approved accounts.  When approved, they become [[User]] cards.  [[http://wagn.org/account|more]]</p>"
17
+ "content": "<p>[[Sign up]] cards represent not-yet-approved accounts. When approved, they become [[User]] cards.  [[http://wagn.org/account|more]]</p>"
18
18
  },
19
19
  {
20
20
  "name": "Config",
@@ -0,0 +1,77 @@
1
+ {
2
+ "url": "http://en.dwagn.org/export.json",
3
+ "timestamp": "2014-11-15 03:44:05 +0000",
4
+ "card": {
5
+ "name": "export",
6
+ "type": "Pointer",
7
+ "content": "[[Config]]\n[[*account]]\n[[Skin+description]]\n[[Sign up+description]]\n[[Toggle+description]]\n[[User+description]]\n[[Email_template+*type+*structure]]\n[[JavaScript+description]]\n[[CSS+description]]\n[[CoffeeScript+description]]\n[[Layout+description]]\n[[Email template+description]]\n[[SCSS+description]]",
8
+ "value": [
9
+ {
10
+ "name": "Config",
11
+ "type": "Basic",
12
+ "content": "<h1>Basics</h1>\r\n<div>Set your site title, home card, and logo image:</div>\r\n<blockquote>\r\n<div>{{*title|closed;type:Phrase}}</div>\r\n<div>{{*home|closed;type:Phrase}}</div>\r\n<div>{{*logo|closed;type:Image}}</div>\r\n</blockquote>\r\n<div> </div>\r\n<h1>Rules</h1>\r\n<div>Cards are configured by creating <em>rules</em>.  All rules impacting a given card can be accessed from its card menu via \"advanced\".</div>\r\n<div> </div>\r\n<div>Here are the site-wide defaults:</div>\r\n<div>\r\n<blockquote>{{*all|closed}}</blockquote>\r\n</div>\r\n<div><em>[[http://wagn.org/rules | More about rules.]]</em></div>\r\n<div> </div>\r\n<h1>Accounts</h1>\r\n<div>{{*accounts}}</div>\r\n<div> </div>\r\n<h1>Emails </h1>\r\n<div>Here are the current [[Email Templates]] for your site.</div>\r\n<blockquote>\r\n<div>{{Email Templates+*type+by update}} </div>\r\n</blockquote>"
13
+ },
14
+ {
15
+ "name": "*account",
16
+ "type": "Basic",
17
+ "content": "<div>When someone signs up, they create a [[Sign up]] card...</div>\r\n<blockquote>\r\n<div>{{Sign up|closed;title: Sign ups}}</div>\r\n</blockquote>\r\n<div>...that can be changed into a [[User]] card:</div>\r\n<blockquote>\r\n<div>{{User|closed}}</div>\r\n</blockquote>\r\n<div>Some important [[http://wagn.org/permissions|permissions]]:</div>\r\n<div>\r\n<ul>\r\n<li>When [[Anyone]] can [[*create|create]] a [[Sign up]] card, links to sign up will appear.</li>\r\n<li>When [[Anyone]] can [[*create|create]] a [[User]] card, each [[Sign up]] can be auto-approved with a verification email.</li>\r\n<li>If permission to [[*create|create]] a [[User]] is restricted, someone with that permission must approve each [[Sign up]] by hand.</li>\r\n</ul>\r\n</div>\r\n<div><em>[[http://wagn.org/account | More about accounts.]]</em></div>",
18
+ "codename": "account"
19
+ },
20
+ {
21
+ "name": "Skin+description",
22
+ "type": "Basic",
23
+ "content": "<p>A [[skin]] determines a page's look and feel.  [[http://wagn.org/Skins|more]]</p>"
24
+ },
25
+ {
26
+ "name": "Sign up+description",
27
+ "type": "Basic",
28
+ "content": "<p>[[Sign up]] cards represent not-yet-approved accounts. When approved, they become [[User]] cards. [[http://wagn.org/account|more]]</p>"
29
+ },
30
+ {
31
+ "name": "Toggle+description",
32
+ "type": "Basic",
33
+ "content": "<p>Toggles simply indicate yes or no. [[http://wagn.org/wagn/Toggle|more]].</p>"
34
+ },
35
+ {
36
+ "name": "User+description",
37
+ "type": "Basic",
38
+ "content": "<p>{{_l|name}} cards can support accounts, profile pages, and more. [[http://wagn.org/Users|more]]</p>"
39
+ },
40
+ {
41
+ "name": "Email template+*type+*structure",
42
+ "type": "Basic",
43
+ "content": "<p>{{+*from | labeled | link}} {{+*to | labeled | link}} {{+*cc | labeled | link}} {{+*bcc | labeled | link}} {{+*subject | titled}} {{+*html message | titled}} {{+*text message | titled}} {{+*attach | titled}}</p>"
44
+ },
45
+ {
46
+ "name": "JavaScript+description",
47
+ "type": "Basic",
48
+ "content": "<p>Create custom JavaScript for [[*script]] rules. [[http://wagn.org/JavaScript|more]]</p>"
49
+ },
50
+ {
51
+ "name": "CSS+description",
52
+ "type": "Basic",
53
+ "content": "<p>Customize styles for [[Skins]]. [[http://wagn.org/CSS|more]]</p>"
54
+ },
55
+ {
56
+ "name": "CoffeeScript+description",
57
+ "type": "Basic",
58
+ "content": "<p>Generate JavaScript for [[*script]] rules. [[http://wagn.org/CoffeeScript|more]]</p>"
59
+ },
60
+ {
61
+ "name": "Layout+description",
62
+ "type": "Basic",
63
+ "content": "<p>Organize webpages. [[http://wagn.org/Layout|more]]</p>"
64
+ },
65
+ {
66
+ "name": "Email template+description",
67
+ "type": "Basic",
68
+ "content": "<p>Design custom emails to be triggered by card actions.  [[http://wagn.org/actions|more]]</p>"
69
+ },
70
+ {
71
+ "name": "SCSS+description",
72
+ "type": "Basic",
73
+ "content": "<p>Customize styles for [[Skins]]. [[http://wagn.org/SCSS|more]]</p>"
74
+ }
75
+ ]
76
+ }
77
+ }
@@ -6,4 +6,4 @@
6
6
 
7
7
  <p>You received this email because you're following <strong>{{_|followed}}</strong>.</p>
8
8
 
9
- <p><em>[[ {{_|unfollow_url}} | Unfollow ]] to stop receiving these emails.</em></p>
9
+ <p><em><a href="{{_|unfollow_url}}">Unfollow</a> to stop receiving these emails.</em></p>
data/db/schema.rb CHANGED
@@ -96,6 +96,12 @@ ActiveRecord::Schema.define(:version => 20141001105348) do
96
96
 
97
97
  add_index "schema_migrations_cards", ["version"], :name => "unique_schema_migrations_cards", :unique => true
98
98
 
99
+ create_table "schema_migrations_deck_cards", :id => false, :force => true do |t|
100
+ t.string "version", :null => false
101
+ end
102
+
103
+ add_index "schema_migrations_deck_cards", ["version"], :name => "unique_schema_migrations_deck_cards", :unique => true
104
+
99
105
  create_table "sessions", :force => true do |t|
100
106
  t.string "session_id"
101
107
  t.text "data"
@@ -28,11 +28,11 @@ Feature: Conflict
28
28
  And I open a new window for Joe User
29
29
  And I edit "Duck Soup" setting content to "Stan Laurel"
30
30
  And I am signed out
31
- And I wait a sec
32
- And I am signed in as Joe Admin
31
+ And I am signed in as Joe Admin
33
32
  And I close window
34
33
  And I submit
35
- Then I'm not sure what I should see but at the moment I get a exception.
34
+ Then I should see "Conflict!"
35
+ And I should see "No difference between your changes and Joe User's version."
36
36
 
37
37
 
38
38
 
@@ -41,7 +41,7 @@ Feature: Watch interface
41
41
  Given Joe User is watching "User"
42
42
  And I go to card Joe User
43
43
  And I hover over the main menu
44
- Then In the main card menu I should see "(following)"
44
+ Then In the main card menu I should see "(following)|unfollow"
45
45
 
46
46
  #too long for menu
47
47
  #
data/lib/card/act.rb CHANGED
@@ -35,7 +35,7 @@ class Card
35
35
  # end
36
36
 
37
37
  def action_on card_id
38
- actions.find_by_card_id(card_id)
38
+ actions.where( :card_id=>card.id, :draft=>[nil, 0] ).first
39
39
  end
40
40
 
41
41
  def elapsed_time
@@ -21,6 +21,7 @@ class CardMigrationGenerator < ActiveRecord::Generators::Base
21
21
 
22
22
  def set_local_assigns!
23
23
  @migration_template = "card_migration.erb"
24
+ @migration_parent_class = options['core'] ? 'Wagn::CoreMigration' : 'Wagn::Migration'
24
25
  case file_name
25
26
  when /^(import)_(.*)(?:\.json)?/
26
27
  @migration_action = $1
@@ -1,9 +1,10 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- class <%= migration_class_name %> < Wagn::Migration
3
+ class <%= migration_class_name %> < <%= @migration_parent_class %>
4
4
  def up
5
- <% if @migration_action == 'import' -%>
6
- import_json "<%= @json_filename %>"
7
- <% end -%>
5
+ <% if @migration_action == 'import' -%>
6
+ import_json "<%= @json_filename %>"
7
+ <% end -%>
8
+
8
9
  end
9
10
  end
@@ -92,7 +92,7 @@ module Wagn
92
92
  add_gem_path paths, "config/routes", :with => "config/routes.rb"
93
93
  add_gem_path paths, "db"
94
94
  add_gem_path paths, "db/migrate"
95
- add_gem_path paths, "db/migrate_cards"
95
+ add_gem_path paths, "db/migrate_core_cards"
96
96
  add_gem_path paths, "db/seeds", :with => "db/seeds.rb"
97
97
  add_gem_path paths, 'gem-mod', :with => 'mod'
98
98
  add_gem_path paths, 'gem-assets', :with => 'public/assets'
data/lib/wagn/commands.rb CHANGED
@@ -52,7 +52,7 @@ else
52
52
  parser = OptionParser.new do |parser|
53
53
  parser.banner = "Usage: wagn seed [options]\n\nCreate and seed the production database specified in config/database.yml\n\n"
54
54
  parser.on('--production','-p', 'seed production database (default)') do
55
- envs = ['test']
55
+ envs = ['production']
56
56
  end
57
57
  parser.on('--test','-t', 'seed test database') do
58
58
  envs = ['test']
@@ -0,0 +1,19 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class Wagn::CoreMigration < Wagn::Migration
4
+ def migration_paths
5
+ Wagn::Migration.core_card_migration_paths
6
+ end
7
+
8
+ def schema_mode
9
+ Wagn::Migration.schema_mode :card
10
+ end
11
+
12
+ def import_json filename
13
+ Wagn.config.action_mailer.perform_deliveries = false
14
+ raw_json = File.read( data_path filename )
15
+ json = JSON.parse raw_json
16
+ Card.merge_list json["card"]["value"], :output_file=>File.join(data_path,"unmerged_#{ filename }")
17
+ #fixme - output file should not be in gem!
18
+ end
19
+ end