card 1.105.0 → 1.105.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/card/director/card_class.rb +17 -14
- data/lib/card/fetch/card_class.rb +19 -13
- data/lib/card/name.rb +3 -3
- data/lib/card/query.rb +8 -5
- data/lib/card/set/abstract.rb +1 -0
- data/lib/card/set/format/abstract_format/wrapper.rb +0 -1
- data/lib/card/set/format/abstract_format.rb +4 -3
- data/lib/card/set/format.rb +46 -20
- data/lib/card/set/helpers.rb +49 -36
- data/lib/card/set/registrar.rb +3 -5
- data/lib/card/set/required_field.rb +3 -2
- data/lib/card/set/type.rb +1 -0
- data/lib/card/set.rb +67 -21
- data/lib/card.rb +30 -12
- data/lib/cardio/command/custom.rb +1 -0
- data/lib/cardio/command/rake_command.rb +1 -1
- data/lib/cardio/command/rspec_command/parser.rb +7 -4
- data/lib/cardio/generators.rb +1 -1
- data/lib/cardio/mod/class_methods.rb +2 -2
- data/lib/cardio/mod/dirs.rb +1 -1
- data/lib/cardio/mod/eat/edibles.rb +21 -1
- data/lib/cardio/mod/eat.rb +4 -2
- data/lib/cardio/mod/modfile_api.rb +2 -2
- data/lib/cardio/mod/sow.rb +16 -16
- data/lib/cardio/mod.rb +30 -48
- data/lib/cardio/railtie.rb +3 -3
- data/lib/generators/mod/mod_generator.rb +5 -5
- data/mod/core/lib/tasks/card/mod.rake +5 -2
- data/mod/core/lib/tasks/card/seed.rake +6 -4
- data/mod/core/lib/tasks/card.rake +8 -4
- data/mod/core/set/all/states.rb +8 -2
- metadata +6 -8
- data/mod/core/lib/tasks/card/assets.rake +0 -17
- data/mod/core/lib/tasks/card/create.rake +0 -81
- /data/mod/core/{locales → config/locales}/de.yml +0 -0
- /data/mod/core/{locales → config/locales}/en.yml +0 -0
@@ -1,81 +0,0 @@
|
|
1
|
-
require "colorize"
|
2
|
-
|
3
|
-
namespace :card do
|
4
|
-
namespace :create do
|
5
|
-
# 1. Creates a js/coffee/css/scss/haml source file with the appropriate path in
|
6
|
-
# the given mod.
|
7
|
-
# If a card with the given name exists it copies the content to that
|
8
|
-
# file.
|
9
|
-
# 2. Creates a self set file that loads the source file as content
|
10
|
-
# 3. Creates a card migration that adds the code card to the script/style
|
11
|
-
# rule defined by ScriptCard/StyleCard.default_rule_name.
|
12
|
-
# Override the set_default_rule_names method to change it.
|
13
|
-
# In the haml case it creates a html card with codename.
|
14
|
-
# @param mod [String] the name of the mod where the files are created
|
15
|
-
# @param name [String] the card name
|
16
|
-
# @param type [String] supported options are js, coffee, css, scss, haml
|
17
|
-
# @param codename [String] optional defaults to key of the name
|
18
|
-
# @param force ["true", "false"] if true override existing files
|
19
|
-
# @example
|
20
|
-
# rake card:create:codefile type=scss mod=standard name="script card"
|
21
|
-
# codename=not_the_key force=true
|
22
|
-
desc "create folders and files for scripts, styles or haml"
|
23
|
-
task codefile: :environment do
|
24
|
-
set_default_rule_names
|
25
|
-
with_params :mod, :name, :type,
|
26
|
-
codename: nil, force: false do |mod, name, type, codename, force|
|
27
|
-
Card::FileCardCreator.new(mod, name, type, codename, force == "true").create
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# override to which rule cards script and styles cards are added
|
32
|
-
def set_default_rule_names
|
33
|
-
# Card::FileCardCreator::ScriptCard.default_rule_name =
|
34
|
-
# Card::FileCardCreator::StyleCard.default_rule_name =
|
35
|
-
end
|
36
|
-
|
37
|
-
# shortcut for create:codefile type=scss
|
38
|
-
desc "create folders and files for stylesheet"
|
39
|
-
task style: :environment do
|
40
|
-
ENV["type"] ||= "scss"
|
41
|
-
Rake::Task["card:create:codefile"].invoke
|
42
|
-
end
|
43
|
-
|
44
|
-
# shortcut for create:codefile type=coffee
|
45
|
-
desc "create folders and files for script"
|
46
|
-
task script: :environment do
|
47
|
-
ENV["type"] ||= "coffee"
|
48
|
-
Rake::Task["card:create:codefile"].invoke
|
49
|
-
end
|
50
|
-
|
51
|
-
# shortcut for create:codefile type=haml
|
52
|
-
desc "create folders and files for haml"
|
53
|
-
task haml: :environment do
|
54
|
-
ENV["type"] ||= "haml"
|
55
|
-
Rake::Task["card:create:codefile"].invoke
|
56
|
-
end
|
57
|
-
|
58
|
-
def with_params *keys
|
59
|
-
optional_params = keys.last.is_a?(Hash) ? keys.pop : {}
|
60
|
-
return unless params_present?(*keys)
|
61
|
-
|
62
|
-
values = keys.map { |k| ENV[k.to_s] }
|
63
|
-
optional_params.each_pair do |k, v|
|
64
|
-
values << (ENV[k.to_s] || v)
|
65
|
-
end
|
66
|
-
yield(*values)
|
67
|
-
end
|
68
|
-
|
69
|
-
def params_present? *env_keys
|
70
|
-
missing = env_keys.reject { |k| ENV[k.to_s] }
|
71
|
-
missing.each do |key|
|
72
|
-
color_puts "missing parameter:", :red, key
|
73
|
-
end
|
74
|
-
missing.empty?
|
75
|
-
end
|
76
|
-
|
77
|
-
def color_puts colored_text, color, text=""
|
78
|
-
puts "#{colored_text.send(color.to_s)} #{text}"
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
File without changes
|
File without changes
|