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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 051a957361e6211cc963ba70fb43de08580a8fa1
4
- data.tar.gz: 306fa2c7c900fd8597cd90851d509a9eaf1bdf14
3
+ metadata.gz: 09039367df10da812535059c591f8b99a4829ee9
4
+ data.tar.gz: 4f6897874ed381d843d215799b2077dd355b95f9
5
5
  SHA512:
6
- metadata.gz: 944d478dc4580175f2a7e253126bedd094039424d2268afa86f48b87e97b38065b7072026cf2c83fe78b5ea07bff0f84353761193a114c0a424d20e8af449a6a
7
- data.tar.gz: cc22749c16024de1f0994fabb3f0d14a533b8c2686a13abf433b3506316eafc54e83cc7a17f016e91f1ceae98e53a93ea94d2c8ec551f1c74db4f4535fdc1433
6
+ metadata.gz: 40aa269f8cadc32110352dd095fdd831ac5193ac23cc81df6c148e0c146022de535efd885cc7379a7841337a16b9bd21ad644086962373972231724ae617b179
7
+ data.tar.gz: 3483f4c5d80f972a619fbce953818e48a8b37cec2ebee9404ea143d2d2ac6bdc30e0c828809b90847636a5ee140c6df3deb84a8aa35fa185f0c7bf476b77f182
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.12.1)
4
+ brief (1.12.2)
5
5
  activesupport (> 3.2)
6
6
  commander (~> 4.3)
7
7
  em-websocket (~> 0.5)
@@ -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 = schema_map.fetch(type_alias) do
16
- raise "Unknown model type: #{ type_alias }. Available types are: #{ schema_map.keys.join(',') }"
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
- content = ask_editor model_class.writing_prompt()
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
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.12.1'
2
+ VERSION = '1.12.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brief
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder