decko 0.11.5 → 0.13.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 +4 -4
- data/lib/card_controller.rb +4 -0
- data/lib/card_controller/errors.rb +11 -13
- data/lib/card_controller/response.rb +0 -12
- data/lib/card_controller/rest.rb +14 -4
- data/lib/decko.rb +2 -15
- data/lib/decko/all.rb +2 -0
- data/lib/decko/application.rb +8 -89
- data/lib/decko/cli.rb +1 -7
- data/lib/decko/commands.rb +17 -110
- data/lib/decko/commands/application.rb +2 -2
- data/lib/decko/commands/cucumber_command.rb +8 -7
- data/lib/decko/commands/cucumber_command/parser.rb +2 -2
- data/lib/decko/engine.rb +1 -45
- data/lib/decko/generators.rb +17 -0
- data/lib/decko/mods_spec_helper.rb +1 -1
- data/lib/decko/railtie.rb +27 -0
- data/lib/decko/script_decko_loader.rb +5 -38
- data/lib/decko/tasks/cucumber.rake +25 -16
- data/lib/decko/tasks/decko.rake +7 -28
- data/lib/decko/tasks/decko/benchmark.rake +38 -0
- data/lib/decko/tasks/decko/docs.rake +1 -1
- data/lib/decko/tasks/decko/seed.rake +16 -7
- data/lib/generators/deck/deck_generator.rb +12 -0
- metadata +25 -72
- data/lib/decko/commands/command.rb +0 -28
- data/lib/decko/commands/rake_command.rb +0 -42
- data/lib/decko/commands/rake_command/parser.rb +0 -35
- data/lib/decko/commands/rspec_command.rb +0 -36
- data/lib/decko/commands/rspec_command/parser.rb +0 -97
- data/lib/decko/config/environments/cucumber.rb +0 -41
- data/lib/decko/config/environments/cypress.rb +0 -100
- data/lib/decko/config/environments/development.rb +0 -95
- data/lib/decko/config/environments/production.rb +0 -75
- data/lib/decko/config/environments/profile.rb +0 -33
- data/lib/decko/config/environments/test.rb +0 -69
- data/lib/decko/config/initializers/secret_token.rb +0 -15
- data/lib/decko/config/initializers/sedate_parser.rb +0 -8
- data/lib/decko/config/initializers/session_store.rb +0 -2
- data/lib/decko/generators/deck/USAGE +0 -9
- data/lib/decko/generators/deck/deck_generator.rb +0 -134
- data/lib/decko/generators/deck/deck_generator/deck_helper.rb +0 -110
- data/lib/decko/generators/deck/deck_generator/interactive.rb +0 -120
- data/lib/decko/generators/deck/deck_generator/rails_overrides.rb +0 -54
- data/lib/decko/generators/deck/templates/Gemfile.erb +0 -56
- data/lib/decko/generators/deck/templates/Rakefile.erb +0 -6
- data/lib/decko/generators/deck/templates/bin/spring.erb +0 -20
- data/lib/decko/generators/deck/templates/config.ru.erb +0 -11
- data/lib/decko/generators/deck/templates/config/application.rb.erb +0 -107
- data/lib/decko/generators/deck/templates/config/boot.rb.erb +0 -11
- data/lib/decko/generators/deck/templates/config/cucumber.yml +0 -1
- data/lib/decko/generators/deck/templates/config/databases/frontbase.yml +0 -34
- data/lib/decko/generators/deck/templates/config/databases/ibm_db.yml +0 -89
- data/lib/decko/generators/deck/templates/config/databases/jdbc.yml +0 -65
- data/lib/decko/generators/deck/templates/config/databases/jdbcmysql.yml +0 -36
- data/lib/decko/generators/deck/templates/config/databases/jdbcpostgresql.yml +0 -46
- data/lib/decko/generators/deck/templates/config/databases/jdbcsqlite3.yml +0 -23
- data/lib/decko/generators/deck/templates/config/databases/mysql.yml +0 -37
- data/lib/decko/generators/deck/templates/config/databases/oracle.yml +0 -42
- data/lib/decko/generators/deck/templates/config/databases/postgresql.yml +0 -39
- data/lib/decko/generators/deck/templates/config/databases/sqlite3.yml +0 -21
- data/lib/decko/generators/deck/templates/config/deck.yml +0 -10
- data/lib/decko/generators/deck/templates/config/environment.rb.erb +0 -5
- data/lib/decko/generators/deck/templates/config/initializers/cypress.rb +0 -12
- data/lib/decko/generators/deck/templates/config/puma.rb +0 -16
- data/lib/decko/generators/deck/templates/config/routes.rb.erb +0 -11
- data/lib/decko/generators/deck/templates/config/storage.yml +0 -0
- data/lib/decko/generators/deck/templates/gitignore +0 -18
- data/lib/decko/generators/deck/templates/pryrc +0 -6
- data/lib/decko/generators/deck/templates/public/files/htaccess +0 -9
- data/lib/decko/generators/deck/templates/public/robots.txt +0 -13
- data/lib/decko/generators/deck/templates/rspec.erb +0 -6
- data/lib/decko/generators/deck/templates/script/decko +0 -6
- data/lib/decko/generators/deck/templates/script/decko_cucumber +0 -8
- data/lib/decko/generators/deck/templates/script/decko_rspec +0 -8
- data/lib/decko/generators/deck/templates/script/delayed_job +0 -5
- data/lib/decko/generators/deck/templates/simplecov.rb.erb +0 -34
- data/lib/decko/generators/deck/templates/spec/javascripts/support/deck_jasmine.yml.erb +0 -56
- data/lib/decko/generators/deck/templates/spec/javascripts/support/decko_jasmine.yml.erb +0 -74
- data/lib/decko/generators/deck/templates/spec/spec_helper.rb +0 -1
- data/rails/application-routes.rb +0 -3
- data/rails/assets/external_link.png +0 -0
- data/rails/assets/jasmine/404.html +0 -27
- data/rails/assets/jasmine/500.html +0 -28
- data/rails/assets/jasmine/card_form.html +0 -13
- data/rails/assets/jquery.min.map +0 -1
- data/rails/engine-routes.rb +0 -53
- data/script/autospec +0 -4
- data/script/decko +0 -6
- data/script/rails +0 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require "cardio/generators/deck_generator_loader"
|
|
2
|
+
|
|
3
|
+
module Cardio
|
|
4
|
+
module Generators
|
|
5
|
+
module Deck
|
|
6
|
+
# Create new Decks (Decko Applications)
|
|
7
|
+
class DeckGenerator
|
|
8
|
+
# TODO: move decko-specific deck components here (eg cucumber)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decko
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ethan McCutchen
|
|
@@ -10,36 +10,50 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2021-
|
|
13
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: actionpack
|
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
|
18
|
+
requirements:
|
|
19
|
+
- - "~>"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 6.1.3.1
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - "~>"
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: 6.1.3.1
|
|
15
29
|
- !ruby/object:Gem::Dependency
|
|
16
30
|
name: card
|
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
|
18
32
|
requirements:
|
|
19
33
|
- - '='
|
|
20
34
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 1.
|
|
35
|
+
version: 1.103.0
|
|
22
36
|
type: :runtime
|
|
23
37
|
prerelease: false
|
|
24
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
39
|
requirements:
|
|
26
40
|
- - '='
|
|
27
41
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 1.
|
|
42
|
+
version: 1.103.0
|
|
29
43
|
- !ruby/object:Gem::Dependency
|
|
30
44
|
name: card-mod-defaults
|
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
|
32
46
|
requirements:
|
|
33
47
|
- - '='
|
|
34
48
|
- !ruby/object:Gem::Version
|
|
35
|
-
version: 0.
|
|
49
|
+
version: 0.13.0
|
|
36
50
|
type: :runtime
|
|
37
51
|
prerelease: false
|
|
38
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
39
53
|
requirements:
|
|
40
54
|
- - '='
|
|
41
55
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: 0.
|
|
56
|
+
version: 0.13.0
|
|
43
57
|
description: a wiki approach to structured data, dynamic interaction, and web design
|
|
44
58
|
email:
|
|
45
59
|
- info@decko.org
|
|
@@ -77,65 +91,12 @@ files:
|
|
|
77
91
|
- lib/decko/cli.rb
|
|
78
92
|
- lib/decko/commands.rb
|
|
79
93
|
- lib/decko/commands/application.rb
|
|
80
|
-
- lib/decko/commands/command.rb
|
|
81
94
|
- lib/decko/commands/cucumber_command.rb
|
|
82
95
|
- lib/decko/commands/cucumber_command/parser.rb
|
|
83
|
-
- lib/decko/commands/rake_command.rb
|
|
84
|
-
- lib/decko/commands/rake_command/parser.rb
|
|
85
|
-
- lib/decko/commands/rspec_command.rb
|
|
86
|
-
- lib/decko/commands/rspec_command/parser.rb
|
|
87
|
-
- lib/decko/config/environments/cucumber.rb
|
|
88
|
-
- lib/decko/config/environments/cypress.rb
|
|
89
|
-
- lib/decko/config/environments/development.rb
|
|
90
|
-
- lib/decko/config/environments/production.rb
|
|
91
|
-
- lib/decko/config/environments/profile.rb
|
|
92
|
-
- lib/decko/config/environments/test.rb
|
|
93
|
-
- lib/decko/config/initializers/secret_token.rb
|
|
94
|
-
- lib/decko/config/initializers/sedate_parser.rb
|
|
95
|
-
- lib/decko/config/initializers/session_store.rb
|
|
96
96
|
- lib/decko/engine.rb
|
|
97
|
-
- lib/decko/generators
|
|
98
|
-
- lib/decko/generators/deck/deck_generator.rb
|
|
99
|
-
- lib/decko/generators/deck/deck_generator/deck_helper.rb
|
|
100
|
-
- lib/decko/generators/deck/deck_generator/interactive.rb
|
|
101
|
-
- lib/decko/generators/deck/deck_generator/rails_overrides.rb
|
|
102
|
-
- lib/decko/generators/deck/templates/Gemfile.erb
|
|
103
|
-
- lib/decko/generators/deck/templates/Rakefile.erb
|
|
104
|
-
- lib/decko/generators/deck/templates/bin/spring.erb
|
|
105
|
-
- lib/decko/generators/deck/templates/config.ru.erb
|
|
106
|
-
- lib/decko/generators/deck/templates/config/application.rb.erb
|
|
107
|
-
- lib/decko/generators/deck/templates/config/boot.rb.erb
|
|
108
|
-
- lib/decko/generators/deck/templates/config/cucumber.yml
|
|
109
|
-
- lib/decko/generators/deck/templates/config/databases/frontbase.yml
|
|
110
|
-
- lib/decko/generators/deck/templates/config/databases/ibm_db.yml
|
|
111
|
-
- lib/decko/generators/deck/templates/config/databases/jdbc.yml
|
|
112
|
-
- lib/decko/generators/deck/templates/config/databases/jdbcmysql.yml
|
|
113
|
-
- lib/decko/generators/deck/templates/config/databases/jdbcpostgresql.yml
|
|
114
|
-
- lib/decko/generators/deck/templates/config/databases/jdbcsqlite3.yml
|
|
115
|
-
- lib/decko/generators/deck/templates/config/databases/mysql.yml
|
|
116
|
-
- lib/decko/generators/deck/templates/config/databases/oracle.yml
|
|
117
|
-
- lib/decko/generators/deck/templates/config/databases/postgresql.yml
|
|
118
|
-
- lib/decko/generators/deck/templates/config/databases/sqlite3.yml
|
|
119
|
-
- lib/decko/generators/deck/templates/config/deck.yml
|
|
120
|
-
- lib/decko/generators/deck/templates/config/environment.rb.erb
|
|
121
|
-
- lib/decko/generators/deck/templates/config/initializers/cypress.rb
|
|
122
|
-
- lib/decko/generators/deck/templates/config/puma.rb
|
|
123
|
-
- lib/decko/generators/deck/templates/config/routes.rb.erb
|
|
124
|
-
- lib/decko/generators/deck/templates/config/storage.yml
|
|
125
|
-
- lib/decko/generators/deck/templates/gitignore
|
|
126
|
-
- lib/decko/generators/deck/templates/pryrc
|
|
127
|
-
- lib/decko/generators/deck/templates/public/files/htaccess
|
|
128
|
-
- lib/decko/generators/deck/templates/public/robots.txt
|
|
129
|
-
- lib/decko/generators/deck/templates/rspec.erb
|
|
130
|
-
- lib/decko/generators/deck/templates/script/decko
|
|
131
|
-
- lib/decko/generators/deck/templates/script/decko_cucumber
|
|
132
|
-
- lib/decko/generators/deck/templates/script/decko_rspec
|
|
133
|
-
- lib/decko/generators/deck/templates/script/delayed_job
|
|
134
|
-
- lib/decko/generators/deck/templates/simplecov.rb.erb
|
|
135
|
-
- lib/decko/generators/deck/templates/spec/javascripts/support/deck_jasmine.yml.erb
|
|
136
|
-
- lib/decko/generators/deck/templates/spec/javascripts/support/decko_jasmine.yml.erb
|
|
137
|
-
- lib/decko/generators/deck/templates/spec/spec_helper.rb
|
|
97
|
+
- lib/decko/generators.rb
|
|
138
98
|
- lib/decko/mods_spec_helper.rb
|
|
99
|
+
- lib/decko/railtie.rb
|
|
139
100
|
- lib/decko/rest_spec_helper.rb
|
|
140
101
|
- lib/decko/script_decko_loader.rb
|
|
141
102
|
- lib/decko/swagger.rb
|
|
@@ -145,19 +106,11 @@ files:
|
|
|
145
106
|
- lib/decko/tasks/cucumber.rake
|
|
146
107
|
- lib/decko/tasks/db.rake
|
|
147
108
|
- lib/decko/tasks/decko.rake
|
|
109
|
+
- lib/decko/tasks/decko/benchmark.rake
|
|
148
110
|
- lib/decko/tasks/decko/docs.rake
|
|
149
111
|
- lib/decko/tasks/decko/seed.rake
|
|
150
112
|
- lib/decko/tasks/decko/tmpsets.rake
|
|
151
|
-
-
|
|
152
|
-
- rails/assets/external_link.png
|
|
153
|
-
- rails/assets/jasmine/404.html
|
|
154
|
-
- rails/assets/jasmine/500.html
|
|
155
|
-
- rails/assets/jasmine/card_form.html
|
|
156
|
-
- rails/assets/jquery.min.map
|
|
157
|
-
- rails/engine-routes.rb
|
|
158
|
-
- script/autospec
|
|
159
|
-
- script/decko
|
|
160
|
-
- script/rails
|
|
113
|
+
- lib/generators/deck/deck_generator.rb
|
|
161
114
|
homepage: https://decko.org
|
|
162
115
|
licenses:
|
|
163
116
|
- GPL-3.0
|
|
@@ -182,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
182
135
|
- !ruby/object:Gem::Version
|
|
183
136
|
version: '0'
|
|
184
137
|
requirements: []
|
|
185
|
-
rubygems_version: 3.1.
|
|
138
|
+
rubygems_version: 3.1.6
|
|
186
139
|
signing_key:
|
|
187
140
|
specification_version: 4
|
|
188
141
|
summary: structured wiki web platform
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# require "English" # needed for CHILD_STATUS, but not sure this is the best place for this.
|
|
2
|
-
|
|
3
|
-
module Decko
|
|
4
|
-
module Commands
|
|
5
|
-
class Command
|
|
6
|
-
def run
|
|
7
|
-
puts command
|
|
8
|
-
exit_with_child_status command
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def exit_with_child_status command
|
|
12
|
-
command += " 2>&1"
|
|
13
|
-
exit $CHILD_STATUS.exitstatus unless system command
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# split special decko args and original command args separated by '--'
|
|
17
|
-
def split_args args
|
|
18
|
-
before_split = true
|
|
19
|
-
decko_args, command_args =
|
|
20
|
-
args.partition do |a|
|
|
21
|
-
before_split = (a == "--" ? false : before_split)
|
|
22
|
-
end
|
|
23
|
-
command_args.shift
|
|
24
|
-
[decko_args, command_args]
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require File.expand_path("command", __dir__)
|
|
2
|
-
# require "pry"
|
|
3
|
-
|
|
4
|
-
module Decko
|
|
5
|
-
module Commands
|
|
6
|
-
class RakeCommand < Command
|
|
7
|
-
def initialize rake_task, args={}
|
|
8
|
-
@task = rake_task
|
|
9
|
-
opts = {}
|
|
10
|
-
if args.is_a? Array
|
|
11
|
-
Parser.new(rake_task, opts).parse!(args)
|
|
12
|
-
else
|
|
13
|
-
opts = args
|
|
14
|
-
end
|
|
15
|
-
@envs = Array(opts[:envs])
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def run
|
|
19
|
-
commands.each do |cmd|
|
|
20
|
-
puts cmd
|
|
21
|
-
# exit_with_child_status cmd
|
|
22
|
-
|
|
23
|
-
result = `#{cmd}`
|
|
24
|
-
process = $?
|
|
25
|
-
puts result
|
|
26
|
-
exit process.exitstatus unless process.success?
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def commands
|
|
31
|
-
task_cmd = "bundle exec rake #{@task}"
|
|
32
|
-
return [task_cmd] if !@envs || @envs.empty?
|
|
33
|
-
|
|
34
|
-
@envs.map do |env|
|
|
35
|
-
"env RAILS_ENV=#{env} #{task_cmd}"
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
require File.expand_path("rake_command/parser", __dir__)
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
|
2
|
-
|
|
3
|
-
require "optparse"
|
|
4
|
-
|
|
5
|
-
module Decko
|
|
6
|
-
module Commands
|
|
7
|
-
class RakeCommand
|
|
8
|
-
class Parser < OptionParser
|
|
9
|
-
def initialize command, opts
|
|
10
|
-
super() do |parser|
|
|
11
|
-
parser.banner = "Usage: decko #{command} [options]\n\n" \
|
|
12
|
-
"Run decko:#{command} task on the production "\
|
|
13
|
-
" database specified in config/database.yml\n\n"
|
|
14
|
-
parser.on("--production", "-p",
|
|
15
|
-
"#{command} production database (default)") do
|
|
16
|
-
opts[:envs] = ["production"]
|
|
17
|
-
end
|
|
18
|
-
parser.on("--test", "-t",
|
|
19
|
-
"#{command} test database") do
|
|
20
|
-
opts[:envs] = ["test"]
|
|
21
|
-
end
|
|
22
|
-
parser.on("--development", "-d",
|
|
23
|
-
"#{command} development database") do
|
|
24
|
-
opts[:envs] = ["development"]
|
|
25
|
-
end
|
|
26
|
-
parser.on("--all", "-a",
|
|
27
|
-
"#{command} production, test, and development database") do
|
|
28
|
-
opts[:envs] = %w[production development test]
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require File.expand_path("command", __dir__)
|
|
2
|
-
|
|
3
|
-
module Decko
|
|
4
|
-
module Commands
|
|
5
|
-
class RspecCommand < Command
|
|
6
|
-
def initialize args
|
|
7
|
-
require "rspec/core"
|
|
8
|
-
require "decko/application"
|
|
9
|
-
|
|
10
|
-
@decko_args, @rspec_args = split_args args
|
|
11
|
-
@opts = {}
|
|
12
|
-
Parser.new(@opts).parse!(@decko_args)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def command
|
|
16
|
-
"#{env_args} #{@opts[:executer]} #{@opts[:rescue]}" \
|
|
17
|
-
"rspec #{@rspec_args.shelljoin} #{@opts[:files]}"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
def env_args
|
|
23
|
-
["RAILS_ROOT=.", coverage].compact.join " "
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def coverage
|
|
27
|
-
# no coverage if rspec was started with file argument
|
|
28
|
-
return unless @opts[:files] || @rspec_args.present?
|
|
29
|
-
|
|
30
|
-
"COVERAGE=false"
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
require File.expand_path("rspec_command/parser", __dir__)
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
|
2
|
-
|
|
3
|
-
require "optparse"
|
|
4
|
-
|
|
5
|
-
module Decko
|
|
6
|
-
module Commands
|
|
7
|
-
class RspecCommand
|
|
8
|
-
class Parser < OptionParser
|
|
9
|
-
RSPEC_PATH_MESSAGE = <<-EOT
|
|
10
|
-
|
|
11
|
-
DECKO ARGS
|
|
12
|
-
|
|
13
|
-
You don't have to give a full path for FILENAME; the basename is enough.
|
|
14
|
-
If FILENAME does not include '_spec', then rspec searches for the
|
|
15
|
-
corresponding spec file.
|
|
16
|
-
The line number always refers to the example in the spec file.
|
|
17
|
-
|
|
18
|
-
EOT
|
|
19
|
-
|
|
20
|
-
def initialize opts
|
|
21
|
-
super() do |parser|
|
|
22
|
-
parser.banner = "Usage: decko rspec [DECKO ARGS] -- [RSPEC ARGS]\n\n" \
|
|
23
|
-
"RSPEC ARGS"
|
|
24
|
-
parser.separator RSPEC_PATH_MESSAGE
|
|
25
|
-
|
|
26
|
-
parser.on("-d", "--spec FILENAME(:LINE)",
|
|
27
|
-
"Run spec for a Decko deck file") do |file|
|
|
28
|
-
opts[:files] = find_spec_file(file, "#{Decko.root}/mod")
|
|
29
|
-
end
|
|
30
|
-
parser.on("-c", "--core-spec FILENAME(:LINE)",
|
|
31
|
-
"Run spec for a Decko core file") do |file|
|
|
32
|
-
opts[:files] = find_spec_file(file, Cardio.gem_root)
|
|
33
|
-
end
|
|
34
|
-
parser.on("-m", "--mod MODNAME",
|
|
35
|
-
"Run all specs for a mod or matching a mod") do |file|
|
|
36
|
-
opts[:files] = find_mod_file(file, Cardio.gem_root)
|
|
37
|
-
end
|
|
38
|
-
parser.on("-s", "--[no-]simplecov", "Run with simplecov") do |s|
|
|
39
|
-
opts[:simplecov] = s ? "TMPSETS=true" : ""
|
|
40
|
-
end
|
|
41
|
-
parser.on("--rescue", "Run with pry-rescue") do
|
|
42
|
-
process_rescue_opts opts
|
|
43
|
-
end
|
|
44
|
-
parser.on("--[no-]spring", "Run with spring") do |spring|
|
|
45
|
-
process_spring_opts spring, opts
|
|
46
|
-
end
|
|
47
|
-
parser.separator "\n"
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
|
|
53
|
-
def process_rescue_opts opts
|
|
54
|
-
if opts[:executer] == "spring"
|
|
55
|
-
puts "Disabled pry-rescue. Not compatible with spring."
|
|
56
|
-
else
|
|
57
|
-
opts[:rescue] = "rescue "
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def process_spring_opts spring, opts
|
|
62
|
-
if spring
|
|
63
|
-
opts[:executer] = "spring"
|
|
64
|
-
if opts[:rescue]
|
|
65
|
-
opts[:rescue] = ""
|
|
66
|
-
puts "Disabled pry-rescue. Not compatible with spring."
|
|
67
|
-
end
|
|
68
|
-
else
|
|
69
|
-
opts[:executer] = "bundle exec"
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def find_mod_file filename, base_dir
|
|
74
|
-
if File.exist?("mod/#{filename}") || File.exist?("#{base_dir}/mod/#{filename}")
|
|
75
|
-
"#{base_dir}/mod/#{filename}"
|
|
76
|
-
elsif (files = find_spec_file(filename, "mod"))&.present?
|
|
77
|
-
files
|
|
78
|
-
else
|
|
79
|
-
find_spec_file(file, "#{base_dir}/mod")
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def find_spec_file filename, base_dir
|
|
84
|
-
file, line = filename.split(":")
|
|
85
|
-
if file.include?("_spec.rb") && File.exist?(file)
|
|
86
|
-
filename
|
|
87
|
-
else
|
|
88
|
-
file = File.basename(file, ".rb").sub(/_spec$/, "")
|
|
89
|
-
Dir.glob("#{base_dir}/**/#{file}_spec.rb").flatten.map do |spec_file|
|
|
90
|
-
line ? "#{spec_file}:#{line}" : file
|
|
91
|
-
end.join(" ")
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
|
2
|
-
|
|
3
|
-
Decko.application.class.configure do
|
|
4
|
-
# Edit at your own peril - it's recommended to regenerate this file
|
|
5
|
-
# in the future when you upgrade to a newer version of Cucumber.
|
|
6
|
-
|
|
7
|
-
config.eager_load = false
|
|
8
|
-
|
|
9
|
-
config.machine_refresh = :never
|
|
10
|
-
|
|
11
|
-
# IMPORTANT: Setting config.cache_classes to false is known to
|
|
12
|
-
# break Cucumber's use_transactional_fixtures method.
|
|
13
|
-
# For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165
|
|
14
|
-
config.cache_classes = true
|
|
15
|
-
|
|
16
|
-
config.prepopulate_cache = true
|
|
17
|
-
|
|
18
|
-
# Log error messages when you accidentally call methods on nil.
|
|
19
|
-
config.whiny_nils = true
|
|
20
|
-
|
|
21
|
-
# Show full error reports and disable caching
|
|
22
|
-
config.consider_all_requests_local = true
|
|
23
|
-
config.action_controller.perform_caching = true
|
|
24
|
-
|
|
25
|
-
# Disable request forgery protection in test environment
|
|
26
|
-
config.action_controller.allow_forgery_protection = false
|
|
27
|
-
|
|
28
|
-
config.active_support.deprecation = :log
|
|
29
|
-
|
|
30
|
-
config.log_level = :debug
|
|
31
|
-
|
|
32
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
33
|
-
# The :test delivery method accumulates sent emails in the
|
|
34
|
-
# ActionMailer::Base.deliveries array.
|
|
35
|
-
config.action_mailer.delivery_method = :test
|
|
36
|
-
|
|
37
|
-
config.use_transactional_fixtures = false
|
|
38
|
-
|
|
39
|
-
config.rescue_all_in_controller = false
|
|
40
|
-
config.raise_all_rendering_errors = true
|
|
41
|
-
end
|