wagn 1.15.pre → 1.15.pre2

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: bdf949be019dcb768fbf0b0422481ecd301803e0
4
- data.tar.gz: 76d5ec5fa5a86d7085402c657e01b4f5d2fed4c7
3
+ metadata.gz: 0e730e4f0587f9ed9cb2be2f38a6acbe2c8a5a91
4
+ data.tar.gz: 8f75540cb3364d479cf2b6807259485e2f61ffac
5
5
  SHA512:
6
- metadata.gz: dc6393e65ad6bb87a1f98bb8d9971707ab115b0f7f54b8661fd25fc3ef5998fcff60a4d867d0bcae46299109ce431d243606c27c4f4e097d038f56df98e323a4
7
- data.tar.gz: 0e5fee8eb58a735a1c475a851082974b27777b63dec4abbf9248ed0ab53dbd5c6b60f6850c340fb5c6f7403bf866f273ea6aa5d9d6130f08751369aef4653d27
6
+ metadata.gz: 515ddc6a266d52d36b53ce34f1ae94849906bc9527aa6d4a7a1751d806d18248ebd0a971246e0dbd51d860ed5b497ba6668548c1e953a4ae27331b9e945a9479
7
+ data.tar.gz: ca3f8c78c99de445207b70b039a9365db55f76abc17e4f50d9c501b178fbb60c75daa2f5f7e3fc80a431e40d77fdbd2d7bbf0dfac5bddc78f1e5ed08e6b69347
@@ -9,7 +9,6 @@ Feature: History
9
9
 
10
10
  Scenario: view history and rollback
11
11
  When I go to url "/First?view=history"
12
- Then show me the page
13
12
  Then In the main card content I should see a del with content "egg"
14
13
 
15
14
  When I expand act 2
@@ -175,9 +175,9 @@ class WagnGenerator < Rails::Generators::AppBase
175
175
  :desc => "seed #{Rails.env}#{ " and test" if options['core-dev'] or options['mod-dev']} database",
176
176
  :command => 'wagn seed',
177
177
  :code => proc do
178
- system("cd #{destination_root} && bundle exec rake wagn:create")
178
+ system("cd #{destination_root} && bundle exec rake wagn:seed")
179
179
  if options['core-dev'] or options['mod-dev']
180
- system("cd #{destination_root} && RAILS_ENV=test bundle exec rake wagn:create")
180
+ system("cd #{destination_root} && RAILS_ENV=test bundle exec rake wagn:seed")
181
181
  end
182
182
  database_seeded.call
183
183
  end
@@ -187,7 +187,7 @@ class WagnGenerator < Rails::Generators::AppBase
187
187
  :command => 'wagn seed --all',
188
188
  :code => proc do
189
189
  %w( production development test ).each do |env|
190
- system("cd #{destination_root} && RAILS_ENV=#{env} bundle exec rake wagn:create")
190
+ system("cd #{destination_root} && RAILS_ENV=#{env} bundle exec rake wagn:seed")
191
191
  end
192
192
  database_seeded.call
193
193
  end
@@ -47,7 +47,7 @@ namespace :db do
47
47
  desc 'Prepare the test database and load the schema'
48
48
  Rake::Task.redefine_task( :prepare => :environment ) do
49
49
  if ENV['RELOAD_TEST_DATA'] == 'true' || ENV['RUN_CODE_RUN']
50
- puts `env RAILS_ENV=test rake wagn:create`
50
+ puts `env RAILS_ENV=test rake wagn:seed`
51
51
  else
52
52
  puts "skipping loading test data. to force, run `env RELOAD_TEST_DATA=true rake db:test:prepare`"
53
53
  end
@@ -42,7 +42,7 @@ namespace :test do
42
42
  # assume we have a good database, ie. just migrated dev db.
43
43
  puts "setting database to wagn_test_template"
44
44
  set_database 'wagn_test_template'
45
- Rake::Task['wagn:create'].invoke
45
+ Rake::Task['wagn:seed'].invoke
46
46
 
47
47
  # I spent waay to long trying to do this in a less hacky way--
48
48
  # Basically initial database setup/migration breaks your models and you really
@@ -312,16 +312,36 @@ namespace :wagn do
312
312
  desc "copy files from template database to standard mod and update cards"
313
313
  task :copy_mod_files => :environment do
314
314
 
315
- mod_name = '05_standard'
316
- template_files_dir = "#{Wagn.root}/files"
317
- standard_files_dir = "#{Cardio.gem_root}/mod/#{mod_name}/file"
318
-
319
- FileUtils.remove_dir standard_files_dir, force=true
320
- FileUtils.cp_r template_files_dir, standard_files_dir
321
-
315
+ source_files_dir = "#{Wagn.root}/files"
322
316
  # add a fourth line to the raw content of each image (or file) to identify it as a mod file
323
317
  Card::Auth.as_bot do
324
318
  Card.search( :type=>['in', 'Image', 'File'], :ne=>'' ).each do |card|
319
+
320
+ if card.attach_mod
321
+ puts "skipping #{card.name}: already in code"
322
+ next
323
+ else
324
+ puts "working on #{card.name}"
325
+ end
326
+
327
+ base_card = card.cardname.junction? ? card.left : card
328
+ raise "need codename for file" unless base_card.codename.present?
329
+
330
+ mod_name = base_card.type_id==Card::SkinID ? '06_bootstrap' : '05_standard'
331
+ source_dir = "#{source_files_dir}/#{card.id}"
332
+
333
+ target_dir = "#{Cardio.gem_root}/mod/#{mod_name}/file/#{base_card.codename}"
334
+ FileUtils.remove_dir target_dir, force=true if Dir.exists? target_dir
335
+ FileUtils.mkdir_p target_dir
336
+
337
+ Dir.entries( source_dir ).each do |filename|
338
+ next if filename =~ /^\./
339
+
340
+ target_filename = filename.gsub /\d+/, card.type_code.to_s
341
+ FileUtils.cp "#{source_dir}/#{filename}", "#{target_dir}/#{target_filename}"
342
+ end
343
+
344
+
325
345
  unless card.db_content.split(/\n/).last == mod_name
326
346
  new_content = card.db_content + "\n#{mod_name}"
327
347
  card.update_column :db_content, new_content
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.pre
4
+ version: 1.15.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-15 00:00:00.000000000 Z
13
+ date: 2015-03-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 1.15.pre
35
+ version: 1.15.pre2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 1.15.pre
42
+ version: 1.15.pre2
43
43
  description: a wiki approach to stuctured data, dynamic interaction, and web design
44
44
  email:
45
45
  - info@wagn.org