decko 0.9.2 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0009a6016bd8f767f1d76e388b713edad0abcaaf85a6c77c6bdc03e83c8407d4'
4
- data.tar.gz: 802012ba6e744887a7b2f6a00e38ee0e9f981a39cdf384511806b76f8703d77d
3
+ metadata.gz: 5c4d11e173080926b6090e4ea9956b6a66ea0e586ea7e4a7bfb153024c31bc66
4
+ data.tar.gz: 2f8758155c3a1928289471ea51dffe4e7db96979786224b625df279785eeb702
5
5
  SHA512:
6
- metadata.gz: 36a24c6d78443dd2a9b8fdda3b7ea47b0fb613bb8ae1d3da9d886bfea541d7bb2514f176ecf997940cb40f5f677bc810ac021e9cd185135697a23924a53155ab
7
- data.tar.gz: 2e4b4e98775847928a52f39f5597eb2814c9c2fc83deee743a2eac3c4fdcc51b5f31c9a810e9cd7e495664d60ac5530f15072f8244f7d290764484899f5e2af2
6
+ metadata.gz: 467dfe8fd38663262c3bdb979315799ea0f79c3788084b7e2fe441a4fd08a284d66357baac04ea01de4aebf9f0b51507dd35de755b5d18945a2e0755b4c13e3d
7
+ data.tar.gz: 626d9a6ece3f0a4c601aa50327d6245bdc119c8a6743450c87b446f05d97edf31993e7fb8d3f6cb6b5d4747452fc220809a7947656e61d363e42f32ef01aad4e
@@ -1,6 +1,6 @@
1
1
  =Decko: you hold the cards
2
2
 
3
- {<img src="https://semaphoreci.com/api/v1/projects/0d61c1f9-5ef0-4c5c-89c6-7664e247e4be/294670/shields_badge.svg" />}[https://semaphoreci.com/ethan/decko]
3
+ {<img src="https://semaphoreci.com/api/v1/ethan/decko/branches/master/shields_badge.svg" />}[https://semaphoreci.com/ethan/decko]
4
4
  {<img src="https://badge.fury.io/rb/decko.svg" alt="Gem Version" />}[https://badge.fury.io/rb/decko]
5
5
  {<img src="https://codeclimate.com/repos/56548cb6fafb98574e013c39/badges/be88db3f72d0fd06ace3/gpa.svg" />}[https://codeclimate.com/repos/56548cb6fafb98574e013c39/feed]
6
6
 
@@ -22,7 +22,7 @@ Try it out!
22
22
 
23
23
  ===1. install dependencies
24
24
 
25
- Ruby[http://www.ruby-lang.org/en/]:: version 2.3.1 or higher
25
+ Ruby[http://www.ruby-lang.org/en/]:: version 2.5 or higher
26
26
  Bundler[http://gembundler.com/]:: version 1.0 or higher
27
27
  ImageMagick[http://www.imagemagick.org/]::
28
28
  A database engine:: Either MySQL[http://www.mysql.com/] or PostgreSQL[http://www.postgresql.org/]
@@ -148,4 +148,4 @@ Installation problems? Installation: https://decko.org/installation
148
148
 
149
149
  If you're looking to go deep into the code, start with http://www.rubydoc.info/gems/card
150
150
 
151
- Thinking about contributing to Decko? here[link:CONTRIBUTING.rdoc]
151
+ Thinking about contributing to Decko? here[link:CONTRIBUTING.md]
@@ -5,21 +5,22 @@ module Decko
5
5
  module Commands
6
6
  class RspecCommand
7
7
  class Parser < OptionParser
8
- def initialize opts
9
- super() do |parser|
10
- parser.banner = "Usage: decko rspec [DECKO ARGS] -- [RSPEC ARGS]\n\n" \
11
- "RSPEC ARGS"
12
- parser.separator <<-EOT
8
+ RSPEC_PATH_MESSAGE = <<-EOT
13
9
 
14
10
  DECKO ARGS
15
11
 
16
- You don't have to give a full path for FILENAME, the basename is enough
17
- If FILENAME does not include '_spec' rspec searches for the
18
- corresponding spec file.
19
- The line number always referes to example in the (corresponding) spec
20
- file.
12
+ You don't have to give a full path for FILENAME; the basename is enough.
13
+ If FILENAME does not include '_spec', then rspec searches for the
14
+ corresponding spec file.
15
+ The line number always refers to the example in the spec file.
16
+
17
+ EOT
21
18
 
22
- EOT
19
+ def initialize opts
20
+ super() do |parser|
21
+ parser.banner = "Usage: decko rspec [DECKO ARGS] -- [RSPEC ARGS]\n\n" \
22
+ "RSPEC ARGS"
23
+ parser.separator RSPEC_PATH_MESSAGE
23
24
 
24
25
  parser.on("-d", "--spec FILENAME(:LINE)",
25
26
  "Run spec for a Decko deck file") do |file|
@@ -31,42 +32,53 @@ module Decko
31
32
  end
32
33
  parser.on("-m", "--mod MODNAME",
33
34
  "Run all specs for a mod or matching a mod") do |file|
34
- opts[:files] =
35
- if File.exist?("mod/#{file}")
36
- "#{Cardio.gem_root}/mod/#{file}"
37
- elsif File.exist?("#{Cardio.gem_root}/mod/#{file}")
38
- "#{Cardio.gem_root}/mod/#{file}"
39
- elsif (files = find_spec_file(file, "mod")) && files.present?
40
- files
41
- else
42
- find_spec_file(file, "#{Cardio.gem_root}/mod")
43
- end
35
+ opts[:files] = find_mod_file(file, Cardio.gem_root)
44
36
  end
45
37
  parser.on("-s", "--[no-]simplecov", "Run with simplecov") do |s|
46
38
  opts[:simplecov] = s ? "" : "COVERAGE=false"
47
39
  end
48
40
  parser.on("--rescue", "Run with pry-rescue") do
49
- if opts[:executer] == "spring"
50
- puts "Disabled pry-rescue. Not compatible with spring."
51
- else
52
- opts[:rescue] = "rescue "
53
- end
41
+ process_rescue_opts opts
54
42
  end
55
43
  parser.on("--[no-]spring", "Run with spring") do |spring|
56
- if spring
57
- opts[:executer] = "spring"
58
- if opts[:rescue]
59
- opts[:rescue] = ""
60
- puts "Disabled pry-rescue. Not compatible with spring."
61
- end
62
- else
63
- opts[:executer] = "bundle exec"
64
- end
44
+ process_spring_opts spring, opts
65
45
  end
66
46
  parser.separator "\n"
67
47
  end
68
48
  end
69
49
 
50
+ private
51
+
52
+ def process_rescue_opts opts
53
+ if opts[:executer] == "spring"
54
+ puts "Disabled pry-rescue. Not compatible with spring."
55
+ else
56
+ opts[:rescue] = "rescue "
57
+ end
58
+ end
59
+
60
+ def process_spring_opts spring, opts
61
+ if spring
62
+ opts[:executer] = "spring"
63
+ if opts[:rescue]
64
+ opts[:rescue] = ""
65
+ puts "Disabled pry-rescue. Not compatible with spring."
66
+ end
67
+ else
68
+ opts[:executer] = "bundle exec"
69
+ end
70
+ end
71
+
72
+ def find_mod_file filename, base_dir
73
+ if File.exist?("mod/#{filename}") || File.exist?("#{base_dir}/mod/#{filename}")
74
+ "#{base_dir}/mod/#{filename}"
75
+ elsif (files = find_spec_file(filename, "mod"))&.present?
76
+ files
77
+ else
78
+ find_spec_file(file, "#{base_dir}/mod")
79
+ end
80
+ end
81
+
70
82
  def find_spec_file filename, base_dir
71
83
  file, line = filename.split(":")
72
84
  if file.include?("_spec.rb") && File.exist?(file)
@@ -22,8 +22,6 @@ Decko.application.class.configure do
22
22
  config.cache_classes = false
23
23
  config.reload_classes_only_on_change = true
24
24
 
25
- config.reload_sets = true
26
-
27
25
  # if defined?(RailsDevTweaks)
28
26
  # config.dev_tweaks.autoload_rules do
29
27
  # skip "/files"
@@ -64,4 +64,7 @@ Decko.application.class.configure do
64
64
 
65
65
  # Send deprecation notices to registered listeners
66
66
  config.active_support.deprecation = :notify
67
+
68
+ # cache the list of set module objects on card objects
69
+ config.cache_set_module_list = true
67
70
  end
@@ -10,7 +10,7 @@ Decko.application.class.configure do
10
10
  # test suite. You never need to work with it otherwise. Remember that
11
11
  # your test database is "scratch space" for the test suite and is wiped
12
12
  # and recreated between test runs. Don't rely on the data there!
13
- config.cache_classes = true
13
+ config.cache_classes = false
14
14
 
15
15
  config.assets.enabled = true if Object.const_defined?(:JasmineRails)
16
16
 
@@ -47,12 +47,12 @@ module Decko
47
47
  ActiveSupport.on_load(:active_record) do
48
48
  ActiveRecord::Base.establish_connection(::Rails.env.to_sym)
49
49
  end
50
- ActiveSupport.on_load(:after_initialize) do
51
- # require "card" if Cardio.load_card?
52
- Card if Cardio.load_card?
53
- rescue ActiveRecord::StatementInvalid => e
54
- ::Rails.logger.warn "database not available[#{::Rails.env}] #{e}"
55
- end
50
+ # ActiveSupport.on_load(:after_initialize) do
51
+ # # require "card" if Cardio.load_card?
52
+ # Card if Cardio.load_card?
53
+ # rescue ActiveRecord::StatementInvalid => e
54
+ # ::Rails.logger.warn "database not available[#{::Rails.env}] #{e}"
55
+ # end
56
56
  end
57
57
  end
58
58
  end
@@ -32,8 +32,8 @@ group :test do
32
32
  gem 'rspec'
33
33
  gem 'rspec-rails', '~>4.0.0.beta2' # behavior-driven-development suite
34
34
  gem 'spork', '>=0.9'
35
- gem 'rubocop'
36
- gem 'rubocop-decko'
35
+ gem 'rubocop', '0.88' # 0.89 introduced bugs. may get resolved in rubocop-decko update?
36
+ # gem 'rubocop-decko'
37
37
  gem 'nokogumbo'
38
38
  end
39
39
 
@@ -21,3 +21,5 @@ CardSpecLoader.each_run do
21
21
  end
22
22
 
23
23
  CardSpecLoader.helper
24
+
25
+ Decko::ModsSpecHelper = :needs_a_value_so_spring_loader_is_happy
@@ -1,6 +1,10 @@
1
1
  module Decko
2
2
  # methods for managing decko responses
3
3
  module Response
4
+ def response_format
5
+ @response_format ||= format_name_from_params
6
+ end
7
+
4
8
  private
5
9
  def respond format, result, status
6
10
  if status.in? [302, 303]
@@ -94,7 +98,7 @@ module Decko
94
98
 
95
99
  def load_format
96
100
  request.format = :html if implicit_html?
97
- card.format format_name_from_params
101
+ card.format response_format
98
102
  end
99
103
 
100
104
  def implicit_html?
@@ -139,7 +143,7 @@ module Decko
139
143
  end
140
144
 
141
145
  def home_mark
142
- Card.global_setting(:home) || "Home"
146
+ Card::Rule.global_setting(:home) || "Home"
143
147
  end
144
148
 
145
149
  def view_does_not_require_name?
@@ -50,7 +50,6 @@ class CardController < ApplicationController
50
50
  before_action :refresh_card, only: [:create, :update, :delete]
51
51
 
52
52
  def setup
53
- Card::Mod::Loader.reload_sets if Cardio.config.reload_sets
54
53
  Card::Machine.refresh_script_and_style unless params[:explicit_file]
55
54
  Card::Cache.renew
56
55
  Card::Env.reset controller: self
@@ -87,10 +86,8 @@ class CardController < ApplicationController
87
86
  # ----------( HELPER METHODS ) -------------
88
87
 
89
88
  def handle
90
- card.act do
91
- Card::Env.success card.name
92
- yield ? cud_success : raise(Card::Error::UserError)
93
- end
89
+ Card::Env.success card.name
90
+ yield ? cud_success : raise(Card::Error::UserError)
94
91
  end
95
92
 
96
93
  # successful create, update, or delete act
@@ -129,6 +126,7 @@ class CardController < ApplicationController
129
126
  show error.class.view, error.class.status_code
130
127
  end
131
128
 
129
+ # TODO: move to exception object
132
130
  def debug_exception? e
133
131
  !e.is_a?(Card::Error::UserError) &&
134
132
  !e.is_a?(ActiveRecord::RecordInvalid) &&
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
8
8
  - Philipp Kühl
9
9
  - Lewis Hoffman
10
10
  - Gerry Gleason
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-02-12 00:00:00.000000000 Z
14
+ date: 2020-09-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: card
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.99.2
22
+ version: 1.100.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.99.2
29
+ version: 1.100.0
30
30
  description: a wiki approach to stuctured data, dynamic interaction, and web design
31
31
  email:
32
32
  - info@decko.org
@@ -145,7 +145,7 @@ licenses:
145
145
  - GPL-2.0
146
146
  - GPL-3.0
147
147
  metadata: {}
148
- post_install_message:
148
+ post_install_message:
149
149
  rdoc_options: []
150
150
  require_paths:
151
151
  - lib
@@ -160,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.0.6
164
- signing_key:
163
+ rubygems_version: 3.0.3
164
+ signing_key:
165
165
  specification_version: 4
166
166
  summary: structured wiki web platform
167
167
  test_files: []