wagn 1.16.1 → 1.16.2

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: 562986691cb64b35396b1ce5d0a90d98e08fb75b
4
- data.tar.gz: 3f575bbdf992ef2e12ff84cc32b569460fb3a9b2
3
+ metadata.gz: ec97a5af91ccb5f9349031a4435c97aa14abdb77
4
+ data.tar.gz: 8e31f2ad73047d4e3d2d3f4f954aa5584c3e0922
5
5
  SHA512:
6
- metadata.gz: 9ee03f9ff2d54e4b164444e7546702979662a076792649424ff068643b5bff73b0d94cee6e3165acb44149159b9a08e843036e077554dd06254f5b4416c0ed88
7
- data.tar.gz: 6657ceb84e467ce75c60b941e687757609a31170ef88892f52cca2e678f7197d1b1e654e60221cb8e3ef96cb63782bffb54e16aaa84c0e6b6aed463806fb2484
6
+ metadata.gz: 7b3f2734bbf8c10be7b3f0ecb54262dcf4a871a6e312bd261a4cd1b618e897ce634d3a3fc17df4e2fdbedcec0e64f6f6e137add16341173f18e77c5a9609361b
7
+ data.tar.gz: b3376aac12150272e1cc8758b94e5e0ea3eef88bd74e5a60ab837ec3cb4271ef2964f58226d0e8a2c9672c41460ad6175a4fe2a288dd448d6e1bce8615286a83
@@ -0,0 +1,104 @@
1
+ =Wagn: how pioneers roll
2
+
3
+ ==Basics
4
+
5
+ Wagn is serious web development made fun.
6
+
7
+ "Wagneers" have used Wagn to create open community sites, private knowledge management sites, public proposal submission sites with private back-ends for review, project management systems, wikis, blogs, journals, forums, and more.
8
+
9
+ Install Wagn, open a webpage, and get started. With Wagn's wiki-inspired building blocks, you can collaborate from day one on content, design, and structure create elegant web systems on the fly. And ruby developers can take these creations even further with Wagn's development framework. Wagn's innovative Mods API supports boundless creativity while integrating seamlessly with structures created on the site.
10
+
11
+ Try it out with automated setup at Cloudstore[https://cldstr.com/wagn.org/wagn] (free hosting for one trial month) or set it up yourself following the instructions below.
12
+
13
+
14
+ ==System Requirements
15
+
16
+ Ruby[http://www.ruby-lang.org/en/]:: version 1.9.3 or higher
17
+ Bundler[http://gembundler.com/]:: version 1.0 or higher
18
+ ImageMagick[http://www.imagemagick.org/]::
19
+ A database engine:: Either MySQL[http://www.mysql.com/] or PostgreSQL[http://www.postgresql.org/]
20
+ Node.js[https://nodejs.org/]:: or another {JavaScript runtime}[https://github.com/sstephenson/execjs]
21
+
22
+ ==Installation
23
+
24
+ ===1. install the gem
25
+
26
+ gem install wagn
27
+
28
+ Watch carefully for errors!
29
+
30
+
31
+ ===2. create a new wagn application
32
+
33
+ wagn new mysite
34
+
35
+
36
+ ===3. create / seed database
37
+
38
+ Edit the config/database.yml file as necessary. More about database configuration at http://www.wagn.org/database_configuration.
39
+
40
+ Then run
41
+
42
+ cd mysite
43
+ wagn seed
44
+
45
+ ..to create and seed the database
46
+
47
+
48
+ ===4. start your server
49
+
50
+ To fire up the default, built-in WEBrick server, just run:
51
+
52
+ wagn server
53
+
54
+ ...and point your browser to http://localhost:3000 (unless otherwise configured).
55
+
56
+ WEBrick is great for a quick test run. To run a production website, see http://www.wagn.org/wagn_in_production.
57
+
58
+
59
+ ==Upgrading
60
+
61
+ ===Standard Upgrades
62
+
63
+ ====1. Backups
64
+ Always back up your database and uploaded files.
65
+
66
+ ====2. Update Libraries
67
+
68
+ From your wagn root directory run:
69
+
70
+ bundle update
71
+
72
+ ====3. Update Database
73
+
74
+ Run the following:
75
+
76
+ wagn update
77
+
78
+ ====4. Restart your server.
79
+
80
+ ===Upgrading pre-gem Wagn sites
81
+
82
+ First check the Wagn version of your existing site.
83
+
84
+ ====Version 1.10 or newer
85
+
86
+ 1. Create a new Wagn app using steps 1 and 2 from the installation section above.
87
+ 2. Copy config/database.yml from the old site to the new one.
88
+ 3. Copy the old local/files contents to the new "files" directory.
89
+ 4. If you have edited wagn.yml in your old site, make the corresponding changes to the new config/application.rb file.
90
+ 5. Follow the standard upgrade procedure above.
91
+
92
+ ====Older than Version 1.10
93
+
94
+ First update your Wagn to version 1.10 via the old update mechanisms, and then follow the directions above.
95
+
96
+
97
+ ==More Resources
98
+
99
+ If you're new to Wagn, you'll find lots more info at http://wagn.org
100
+
101
+ If you're looking to go deep into the code, start with this introduction
102
+
103
+
104
+
@@ -50,6 +50,7 @@ Feature: Follow interface
50
50
  And I go to card Joe User
51
51
  And I open the main card menu
52
52
  Then In the main card menu I should see "(following)|unfollow"
53
+ And I wait a sec
53
54
 
54
55
  #too long for menu
55
56
  #
@@ -1,21 +1,22 @@
1
1
  @javascript
2
2
  Feature: History
3
- As an editor
3
+ As an editor
4
4
  I want to be able to browse through the history and save an old version as current.
5
-
5
+
6
6
  Background:
7
7
  Given I am signed in as Joe Admin
8
8
  Then the card First should not contain "chicken"
9
-
10
- Scenario: view history and rollback
9
+
10
+ Scenario: view history and rollback
11
11
  When I go to url "/First?view=history"
12
12
  Then In the main card content I should see a del with content "egg"
13
-
13
+
14
14
  When I expand act 2
15
15
  And In the main card content I click "Hide changes"
16
16
  Then In the main card content I should not see a del with content "egg"
17
17
 
18
18
  When In the main card content I click "Save as current"
19
19
  Then the card First should contain "chicken"
20
-
21
-
20
+ Then I wait a sec
21
+
22
+
@@ -206,6 +206,17 @@ When /^In (.*) I find link with class "(.*)" and click it$/ do |section, css_cla
206
206
  end
207
207
  end
208
208
 
209
+ When /^In (.*) I find link with icon "(.*)" and click it$/ do |section, icon|
210
+ within scope_of(section) do
211
+ find("a > span.glyphicon-#{icon}").click
212
+ end
213
+ end
214
+ When /^In (.*) I find button with icon "(.*)" and click it$/ do |section, icon|
215
+ within scope_of(section) do
216
+ find("button > span.glyphicon-#{icon}").click
217
+ end
218
+ end
219
+
209
220
  Then /I submit$/ do
210
221
  click_button("Submit")
211
222
  end
@@ -5,6 +5,8 @@ require File.expand_path( '../../../lib/wagn/simplecov_helper.rb', __FILE__ )
5
5
  require 'simplecov'
6
6
  require 'minitest/autorun'
7
7
 
8
+ require 'pry'
9
+
8
10
  # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
9
11
  # It is recommended to regenerate this file in the future when you upgrade to a
10
12
  # newer version of cucumber-rails. Consider adding your own code to a new file
@@ -15,6 +15,12 @@ module ScopeHelpers
15
15
  when /main card menu/
16
16
  '#main > .card-slot > .menu-slot > .card-menu'
17
17
 
18
+ when /main card toolbar/
19
+ '#main > .card-slot > .card-frame > nav.toolbar'
20
+
21
+ when /main card frame/
22
+ '#main > .card-slot > .card-frame'
23
+
18
24
  else
19
25
  raise "Can't find mapping from \"#{section}\" to a scope.\n" +
20
26
  "Now, go and add a mapping in #{__FILE__}"
@@ -0,0 +1,30 @@
1
+ @javascript
2
+ Feature: Toolbar
3
+ In order to edit a card
4
+ As a Wagneer
5
+ I want to be able to use the toolbar
6
+
7
+ Background:
8
+ Given I am signed in as Joe Admin
9
+ And I go to card "Home"
10
+ And I open the main card menu
11
+ And I follow "edit"
12
+
13
+ Scenario: close toolbar
14
+ Then In main card frame I should see a nav with class "toolbar"
15
+ When In main card toolbar I find link with icon "remove" and click it
16
+ Then In main card frame I should not see a nav with class "toolbar"
17
+
18
+ Scenario: pin and unpin toolbar
19
+ When In main card toolbar I find button with icon "pushpin" and click it
20
+ And I go to card "Home"
21
+ Then In main card frame I should see a nav with class "toolbar"
22
+ And In main card toolbar I should see a button with class "toolbar-pin.active"
23
+
24
+ When In main card toolbar I find button with icon "pushpin" and click it
25
+ And I go to card "Home"
26
+ Then In main card frame I should not see a nav with class "toolbar"
27
+
28
+
29
+
30
+
@@ -1,25 +1,24 @@
1
- # should be able to move these to more appropriate places
2
- WAGN_GEM_ROOT = File.expand_path('../..', __FILE__)
3
1
 
4
2
  module Wagn
3
+ WAGN_GEM_ROOT = File.expand_path('../..', __FILE__)
5
4
 
6
- class << self
5
+ class << self
7
6
  def root
8
7
  Rails.root
9
8
  end
10
-
9
+
11
10
  def application
12
11
  Rails.application
13
12
  end
14
-
13
+
15
14
  def config
16
15
  application.config
17
16
  end
18
-
17
+
19
18
  def paths
20
19
  application.paths
21
20
  end
22
-
21
+
23
22
  def gem_root
24
23
  WAGN_GEM_ROOT
25
24
  end
@@ -78,14 +78,16 @@ module Wagn
78
78
  paths = super
79
79
  Cardio.set_paths paths
80
80
 
81
+ paths['mod'] << 'mod'
81
82
  paths.add 'files'
82
83
 
83
- paths['mod'] << 'mod'
84
84
  paths['app/models'] = []
85
85
  paths['app/mailers'] = []
86
86
 
87
87
  add_path paths, 'config/routes.rb', :with => 'rails/application-routes.rb'
88
88
 
89
+ Cardio.set_mod_paths #really this should happen later
90
+
89
91
  paths
90
92
  end
91
93
  end
@@ -39,7 +39,7 @@ namespace :db do
39
39
  fixture_path = File.join(Cardio.gem_root, 'db','seed', 'test', 'fixtures')
40
40
  ActiveRecord::Base.establish_connection(::Rails.env.to_sym)
41
41
  (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(fixture_path, '*.{yml,csv}'))).each do |fixture_file|
42
- ActiveRecord::Fixtures.create_fixtures(fixture_path, File.basename(fixture_file, '.*'))
42
+ ActiveRecord::FixtureSet.create_fixtures(fixture_path, File.basename(fixture_file, '.*'))
43
43
  end
44
44
  end
45
45
  end
@@ -65,7 +65,9 @@ namespace :test do
65
65
 
66
66
  desc "dump current db to test fixtures"
67
67
  task :extract_fixtures => :environment do
68
- YAML::ENGINE.yamler = 'syck'
68
+ if RUBY_VERSION !~ /^(2|1\.9)/
69
+ YAML::ENGINE.yamler = 'syck'
70
+ end
69
71
  # use old engine while we're supporting ruby 1.8.7 because it can't support Psych,
70
72
  # which dumps with slashes that syck can't understand (also !!null stuff)
71
73
 
@@ -288,7 +288,9 @@ namespace :wagn do
288
288
 
289
289
  Rake::Task['wagn:bootstrap:copy_mod_files'].invoke
290
290
 
291
- YAML::ENGINE.yamler = 'syck'
291
+ if RUBY_VERSION !~ /^(2|1\.9)/
292
+ YAML::ENGINE.yamler = 'syck'
293
+ end
292
294
  # use old engine while we're supporting ruby 1.8.7 because it can't support Psych,
293
295
  # which dumps with slashes that syck can't understand
294
296
 
@@ -315,45 +317,39 @@ namespace :wagn do
315
317
  task :copy_mod_files => :environment do
316
318
 
317
319
  source_files_dir = "#{Wagn.root}/files"
318
- # add a fourth line to the raw content of each image (or file) to identify it as a mod file
320
+
321
+ # mark mod files as mod files
319
322
  Card::Auth.as_bot do
320
323
  Card.search( :type=>['in', 'Image', 'File'], :ne=>'' ).each do |card|
321
-
322
- if card.attach_mod
323
- # puts "skipping #{card.name}: already in code"
324
+ if card.mod_file?
325
+ puts "skipping #{card.name}: already in code"
324
326
  next
325
327
  else
326
- # puts "working on #{card.name}"
328
+ puts "working on #{card.name}"
327
329
  end
328
330
 
329
- base_card = card.cardname.junction? ? card.left : card
330
- raise "need codename for file" unless base_card.codename.present?
331
+ raise "need codename for file" unless card.codename.present?
332
+
333
+ files = {:original => card.attachment.path}
334
+ card.attachment.versions.each_key do |version|
335
+ files[version] = card.attachment.path(version)
336
+ end
331
337
 
332
- mod_name = base_card.type_id==Card::SkinID ? '06_bootstrap' : '05_standard'
333
- source_dir = "#{source_files_dir}/#{card.id}"
338
+ # make card a mod file card
339
+ mod_name = (l = card.left) && l.type_id==Card::SkinID ? '06_bootstrap' : '05_standard'
340
+ card.update_column :db_content, card.attachment.db_content(:mod=>mod_name)
341
+ card.last_action.change_for(2).first.update_column :value, card.attachment.db_content(:mod=>mod_name)
342
+ card.expire
343
+ card = Card.fetch card.name
334
344
 
335
- target_dir = "#{Cardio.gem_root}/mod/#{mod_name}/file/#{base_card.codename}"
345
+ target_dir = card.store_dir
336
346
  FileUtils.remove_dir target_dir, force=true if Dir.exists? target_dir
337
347
  FileUtils.mkdir_p target_dir
338
348
 
339
- # if card.name =~ /icon/
340
- # require 'pry'; binding.pry
341
- # end
342
- Dir.entries( source_dir ).each do |filename|
343
- next if filename =~ /^\./
344
- next if filename !~ (Regexp.new card.last_content_action_id.to_s)
345
-
346
- target_filename = filename.gsub /\d+/, card.type_code.to_s
347
- FileUtils.cp "#{source_dir}/#{filename}", "#{target_dir}/#{target_filename}"
349
+ files.each do |version, path|
350
+ FileUtils.cp path, card.attachment.path(version)
348
351
  end
349
352
 
350
-
351
- unless card.db_content.split(/\n/).last == mod_name
352
- new_content = card.db_content + "\n#{mod_name}"
353
- card.update_column :db_content, new_content
354
- card.last_action.change_for(2).first.update_column :value, new_content
355
- #FIXME - should technically update the change as well...
356
- end
357
353
  end
358
354
  end
359
355
  end
@@ -5,8 +5,10 @@ Decko::Engine.routes.draw do
5
5
 
6
6
  #most common
7
7
  root 'card#read'
8
+ get "#{ Decko::Engine.config.files_web_path }/:id/:rev_id(-:size).:format" =>
9
+ 'card#read', :id => /[^-]+/, :rev_id=> /[^-]+/, :explicit_file=>true
8
10
  get "#{ Decko::Engine.config.files_web_path }/:id(-:size)-:rev_id.:format" =>
9
- 'card#read', :id => /[^-]+/, :explicit_file=>true
11
+ 'card#read', :id => /[^-]+/, :explicit_file=>true # deprecated
10
12
  get "assets/*filename" => 'card#asset'
11
13
  get "javascripts/*filename" => 'card#asset'
12
14
  get "jasmine/*filename" => 'card#asset'
@@ -260,7 +260,7 @@ describe CardController do
260
260
  context "file" do
261
261
  before do
262
262
  Card::Auth.as_bot do
263
- Card.create :name => "mao2", :type_code=>'image', :attach=>File.new( File.join FIXTURES_PATH, 'mao2.jpg' )
263
+ Card.create :name => "mao2", :type_code=>'image', :image=>File.new( File.join FIXTURES_PATH, 'mao2.jpg' )
264
264
  Card.create :name => 'mao2+*self+*read', :content=>'[[Administrator]]'
265
265
  end
266
266
  end
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.16.1
4
+ version: 1.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-07-30 00:00:00.000000000 Z
14
+ date: 2015-08-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.16.1
36
+ version: 1.16.2
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.16.1
43
+ version: 1.16.2
44
44
  description: a wiki approach to stuctured data, dynamic interaction, and web design
45
45
  email:
46
46
  - info@wagn.org
@@ -53,6 +53,7 @@ files:
53
53
  - GPL
54
54
  - Guardfile
55
55
  - LICENSE
56
+ - README.rdoc
56
57
  - app/assets/images/body-bg.bmp
57
58
  - app/assets/images/body-bg.png
58
59
  - app/assets/images/external_link.png
@@ -101,6 +102,7 @@ files:
101
102
  - features/support/scopes.rb
102
103
  - features/support/wagn_env.rb
103
104
  - features/table_of_contents.feature
105
+ - features/toolbar.feature
104
106
  - features/update_includers.feature
105
107
  - lib/decko/engine.rb
106
108
  - lib/wagn.rb
@@ -747,7 +749,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
747
749
  version: '0'
748
750
  requirements: []
749
751
  rubyforge_project:
750
- rubygems_version: 2.4.3
752
+ rubygems_version: 2.4.8
751
753
  signing_key:
752
754
  specification_version: 4
753
755
  summary: structured wiki web platform
@@ -777,6 +779,7 @@ test_files:
777
779
  - features/support/scopes.rb
778
780
  - features/support/wagn_env.rb
779
781
  - features/table_of_contents.feature
782
+ - features/toolbar.feature
780
783
  - features/update_includers.feature
781
784
  - spec/controllers/card_controller_spec.rb
782
785
  - spec/controllers/location_spec.rb
@@ -794,4 +797,3 @@ test_files:
794
797
  - test/script/run_engine_deck.sh
795
798
  - test/script/run_mig.sh
796
799
  - test/test_helper.rb
797
- has_rdoc: