decko 0.13.3 → 0.14.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
  SHA256:
3
- metadata.gz: b82215085ce662ffdbc50f1471804250cee8e8a44a408d73c9bae14297694b34
4
- data.tar.gz: 7e5f0e5202b6ab9b4336f2a4036e7a051d9680b1a12c04e5956cf7597680b91e
3
+ metadata.gz: 3c6db755b2db7ac79e35bb2b9d5f2b8b38edaeb528985cd00631c5b0e6f883e2
4
+ data.tar.gz: 7a6b0e083047509d211e77a8fd68e5c22bc2bc081d40c933f3777ee17e498aa3
5
5
  SHA512:
6
- metadata.gz: c9a6477f01c6631fab7789cf1c3cc19070beaf88c358ffaa33036c1e2e1b96421e0a0578df4b505f7721fadfcd76a5b46efdc4034f0a8558bc2a34e3e129ee81
7
- data.tar.gz: b18037ed8779e84de2e66dcdfeabdf0285a4b30d6cbb7dd989f3fd1193e16939ee5d4a3b20ad6c89920862addd2b501106cc34cb4f0e21f22ee3bb8e07049f9f
6
+ metadata.gz: 04ad5d539b80b8c5ae27f2c1bcc8d716c6a4a5ec36283410797320896f861a8124e141901bcdd0cc7e45522c46d516840c155e20b0812f6182353cd131c8c50c
7
+ data.tar.gz: bb637881c97f37183f475c952ee2af0ef71b5cc8089bbd854d729d72a9963c54038ace067b2ec238a9215daab02d97bd41114d1356d1a55c6830af905114ce8a
@@ -6,7 +6,7 @@ Decko.application.class.configure do
6
6
 
7
7
  config.eager_load = false
8
8
 
9
- config.machine_refresh = :never
9
+ config.asset_refresh = :never
10
10
 
11
11
  # IMPORTANT: Setting config.cache_classes to false is known to
12
12
  # break Cucumber's use_transactional_fixtures method.
@@ -1,5 +1,6 @@
1
1
  if defined?(CypressOnRails)
2
2
  require "simplecov"
3
+ SimpleCov.start
3
4
 
4
5
  CypressOnRails.configure do |c|
5
6
  c.cypress_folder = File.join Decko.gem_root, "spec", "cypress"
@@ -21,7 +21,8 @@ class CardController
21
21
 
22
22
  def explicit_mark mark
23
23
  # we should find the place where we produce these bad urls
24
- mark.valid_encoding? ? mark : mark.force_encoding("ISO-8859-1").encode("UTF-8")
24
+ # mark.valid_encoding? ? mark : mark.force_encoding("ISO-8859-1").encode("UTF-8")
25
+ mark
25
26
  end
26
27
 
27
28
  def implicit_mark
@@ -54,7 +54,8 @@ class CardController
54
54
  # Card::Cache.renew
55
55
  @card = success.target
56
56
  require_card_for_soft_redirect!
57
- self.params = Card::Env[:params] = soft_redirect_params
57
+ self.params = soft_redirect_params
58
+ Card::Env.reset self
58
59
  load_action
59
60
  show
60
61
  end
@@ -29,9 +29,9 @@ class CardController
29
29
  private
30
30
 
31
31
  def setup
32
- Card::Machine.refresh_assets unless params[:explicit_file]
32
+ Card::Assets.refresh_assets unless params[:explicit_file]
33
33
  Card::Cache.renew
34
- Card::Env.reset controller: self
34
+ Card::Env.reset self
35
35
  end
36
36
 
37
37
  def authenticate
@@ -39,6 +39,8 @@ class CardController
39
39
  end
40
40
 
41
41
  def authenticators
42
+ return {} unless request
43
+
42
44
  { token: token_from_header || params[:token] }
43
45
  end
44
46
 
@@ -62,7 +64,7 @@ class CardController
62
64
 
63
65
  # TODO: refactor this away this when new layout handling is ready
64
66
  def record_as_main
65
- Card::Env[:main_name] = params[:main] || card&.name || ""
67
+ Card::Env.main_name = params[:main] || card&.name || ""
66
68
  end
67
69
 
68
70
  def refresh_card
@@ -4,23 +4,28 @@ require "cardio/commands"
4
4
 
5
5
  module Decko
6
6
  class Commands < Cardio::Commands
7
- extend Cardio::Commands::Accessors
7
+ def map
8
+ @map ||= super.merge(
9
+ server: { desc: "start a local web server", group: :shark, alias: :s },
10
+ cucumber: { desc: "run cucumber tests", group: :monkey, alias: :cc, via: :call}
11
+ )
12
+ end
13
+
14
+ def generator_requirement
15
+ "decko/generators"
16
+ end
8
17
 
9
- commands[:rails] << (aliases["s"] = "server")
10
- commands[:custom] << (aliases["cc"] = "cucumber")
18
+ def gem
19
+ "decko"
20
+ end
11
21
 
12
22
  def run_cucumber
13
23
  require "decko/commands/cucumber_command"
14
24
  CucumberCommand.new(args).run
15
25
  end
16
26
 
17
- def rake_prefix
18
- "decko"
19
- end
20
-
21
- def run_rails
22
- require "decko/generators" if command == "generate"
23
- super
27
+ def run_version
28
+ puts "Decko #{Cardio::Version.release}".light_cyan
24
29
  end
25
30
 
26
31
  new(ARGV).run
@@ -1,17 +1,3 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  require "cardio/generators"
4
- require "cardio/generators/class_methods"
5
-
6
- # note: despite the decko file name the base class is Cardio
7
- module Cardio
8
- module Generators
9
- # main definition of this module is in card gem
10
- module ClassMethods
11
- # generator USAGE docs will use "decko" rather than "card" when called with decko
12
- def banner_command
13
- "decko"
14
- end
15
- end
16
- end
17
- end
@@ -15,10 +15,6 @@ CardSpecLoader.prefork do
15
15
  CardSpecLoader.rspec_config
16
16
  end
17
17
 
18
- CardSpecLoader.each_run do
19
- # This code will be run each time you run your specs.
20
- end
21
-
22
18
  CardSpecLoader.helper
23
19
 
24
20
  Decko::ModsSpecHelper = :needs_a_value_so_spring_loader_is_happy
@@ -5,6 +5,7 @@ module Cardio
5
5
  module Deck
6
6
  # Create new Decks (Decko Applications)
7
7
  class DeckGenerator
8
+ extend ClassMethods
8
9
  # TODO: move decko-specific deck components here (eg cucumber)
9
10
  end
10
11
  end
@@ -6,7 +6,9 @@ namespace :decko do
6
6
  task update: :environment do
7
7
  ENV["STAMP_MIGRATIONS"] = "true"
8
8
  ENV["GENERATE_FIXTURES"] = "true"
9
- %w[reseed update mod:install seed:clean seed:supplement seed:dump].each do |task|
9
+ %w[reseed update
10
+ mod:uninstall mod:install seed:make_asset_output_coded
11
+ seed:clean seed:supplement seed:dump].each do |task|
10
12
  Rake::Task["decko:#{task}"].invoke
11
13
  end
12
14
  end
@@ -24,7 +26,8 @@ namespace :decko do
24
26
  # change actors so we can delete unwanted user cards that made changes
25
27
  Card::Act.update_all actor_id: Card::WagnBotID
26
28
  delete_ignored_cards
27
- clean_machines
29
+ refresh_assets
30
+ Card::Assets.make_output_coded
28
31
  # clean_unwanted_cards
29
32
  Card.empty_trash
30
33
  end
@@ -41,53 +44,22 @@ namespace :decko do
41
44
  end
42
45
  end
43
46
 
44
- task clean_machines: :environment do
45
- clean_machines
47
+ task refresh_assets: :environment do
48
+ refresh_assets
46
49
  end
47
50
 
48
- def clean_machines
49
- puts "clean machines"
50
- Card::Machine.reset_all
51
- reseed_machine_output
52
- clean_inputs_and_outputs
53
- end
54
-
55
- def reseed_machine_output
56
- machine_seed_names.each do |name|
57
- puts "coding machine output for #{name}"
58
- Card[name].make_machine_output_coded
59
- end
60
- Card.search(type_id: Card::ModScriptAssetsID) do |card|
61
- card.make_machine_output_coded true
62
- end
63
- end
64
-
65
- def clean_inputs_and_outputs
66
- # FIXME: can this be associated with the machine module somehow?
67
- %w[machine_input machine_output machine_cache].each do |codename|
68
- Card.search(right: { codename: codename }).each do |card|
69
- FileUtils.rm_rf File.join("files", card.id.to_s), secure: true
70
- next if reserved_output? card.name
71
-
72
- card.delete!
73
- end
51
+ def refresh_assets
52
+ puts "refresh assets"
53
+ Card::Auth.as_bot do
54
+ Card.where(right_id: :asset_input.card_id).delete_all
74
55
  end
56
+ Card::Cache.reset_all
57
+ Cardio.config.compress_assets = true
58
+ Card::Assets.refresh_assets force: true
75
59
  end
76
60
 
77
- def reserved_output? name
78
- machine_seed_member?(name) &&
79
- (name.right_name.key == :machine_output.cardname.key)
80
- end
81
-
82
- def machine_seed_member? name
83
- machine_seed_names.member?(name.left_name.key) || name.match(/^mod:/)
84
- end
85
-
86
- def machine_seed_names
87
- @machine_seed_names ||=
88
- [%i[all style], [:script_html5shiv_printshiv]].map do |name|
89
- Card::Name[*name]
90
- end
61
+ task make_asset_output_coded: :environment do
62
+ Card::Assets.make_output_coded
91
63
  end
92
64
 
93
65
  # def clean_files
@@ -94,13 +94,15 @@ decko_namespace = namespace :decko do
94
94
  decko_namespace["migrate"].invoke
95
95
  decko_namespace["reset_tmp"].invoke
96
96
  Card::Cache.reset_all
97
+ Rake::Task["card:mod:uninstall"].invoke
97
98
  Rake::Task["card:mod:install"].invoke
98
99
  Rake::Task["card:mod:symlink"].invoke
99
100
  end
100
101
  end
101
102
 
102
- alias_task "mod:symlink", "card:mod:symlink"
103
- alias_task "mod:install", "card:mod:install"
103
+ %i[list symlink missing uninstall install].each do |task|
104
+ alias_task "mod:#{task}", "card:mod:#{task}"
105
+ end
104
106
  alias_task :migrate, "card:migrate"
105
107
 
106
108
  desc "insert existing card migrations into schema_migrations_cards " \
@@ -112,8 +114,7 @@ decko_namespace = namespace :decko do
112
114
 
113
115
  def seed with_cache_reset: true
114
116
  ENV["SCHEMA"] ||= "#{Cardio.gem_root}/db/schema.rb"
115
- # FIXME: this should be an option, but should not happen on standard
116
- # creates!
117
+ # FIXME: this should be an option, but should not happen on standard creates!
117
118
  begin
118
119
  Rake::Task["db:drop"].invoke
119
120
  rescue StandardError
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.13.3
4
+ version: 0.14.2
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: 2021-09-24 00:00:00.000000000 Z
13
+ date: 2022-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -32,28 +32,28 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 1.103.3
35
+ version: 1.104.2
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.103.3
42
+ version: 1.104.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-defaults
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.13.3
49
+ version: 0.14.2
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.13.3
56
+ version: 0.14.2
57
57
  description: a wiki approach to structured data, dynamic interaction, and web design
58
58
  email:
59
59
  - info@decko.org
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.1.6
147
+ rubygems_version: 3.2.15
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: structured wiki web platform