brief 1.12.1 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/brief/cli/write.rb +9 -5
- data/lib/brief/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09039367df10da812535059c591f8b99a4829ee9
|
4
|
+
data.tar.gz: 4f6897874ed381d843d215799b2077dd355b95f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40aa269f8cadc32110352dd095fdd831ac5193ac23cc81df6c148e0c146022de535efd885cc7379a7841337a16b9bd21ad644086962373972231724ae617b179
|
7
|
+
data.tar.gz: 3483f4c5d80f972a619fbce953818e48a8b37cec2ebee9404ea143d2d2ac6bdc30e0c828809b90847636a5ee140c6df3deb84a8aa35fa185f0c7bf476b77f182
|
data/Gemfile.lock
CHANGED
data/lib/brief/cli/write.rb
CHANGED
@@ -8,15 +8,19 @@ command 'write' do |c|
|
|
8
8
|
c.action do |args, options|
|
9
9
|
options.default(root: Pathname(Brief.pwd))
|
10
10
|
briefcase = Brief.case = Brief::Briefcase.new(root: options.root)
|
11
|
-
schema_map = briefcase.schema_map()
|
12
|
-
|
13
11
|
type_alias = args.first
|
14
12
|
|
15
|
-
model_class =
|
16
|
-
|
13
|
+
model_class = briefcase.model_classes.find {|c| c.type_alias == type_alias }
|
14
|
+
|
15
|
+
if !model_class.nil?
|
16
|
+
content = ask_editor model_class.writing_prompt()
|
17
|
+
else
|
18
|
+
model_class = briefcase.schema_map.fetch(type_alias, nil)
|
19
|
+
content = ask_editor(model_class.example)
|
17
20
|
end
|
18
21
|
|
19
|
-
|
22
|
+
raise "Inavlid model class. Run the schema command to see what is available." if model_class.nil?
|
23
|
+
|
20
24
|
|
21
25
|
file = ask("Enter a filename")
|
22
26
|
|
data/lib/brief/version.rb
CHANGED