brief 1.9.1 → 1.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0457268f9d394e5149e2bc1b48189c5c6baf91b2
4
- data.tar.gz: 429a4e214373841c3db8281246228f4b00b4d2ea
3
+ metadata.gz: 3986559b2d00c997b91f9fef8d1adda8830b5907
4
+ data.tar.gz: b959ef3fe431b2da4e4a3acf857dc174e82b9337
5
5
  SHA512:
6
- metadata.gz: 8df3869a124d86b6554fc933648b686a0a308377f5399b79e4a93da25985e992e51283fbeb5f5a2cfb0d0230d8a171e75bd9b4cb537af5a0dc464f7df00303e9
7
- data.tar.gz: 011ceb6a4b2c6cb359816b8acc708ed9d32f8095e9b613e14776930677c4b86e0998a4ce4baa235236795c51e50c1592d1ae5d7e68acbb4541d511831e4d4cc0
6
+ metadata.gz: a7bb4ff6a9bc110c6e2c69277d748ecc955fb47586c0556ff3f812236de266ee3077d4f2efc33b675427711e93dd8ef677432e5b1145bf8f7764f62b4d3a05c1
7
+ data.tar.gz: 66121eaf98cfe7bf55123c294477ba39e8c705edd14b25dea821d6e378dc11f58cfcbb7276f91c17e08a579ff41c7c6bf971233f75a97ecbffdc27c21bd4a90b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.9.1)
4
+ brief (1.9.2)
5
5
  activesupport (>= 4.0)
6
6
  commander (>= 4.2.1)
7
7
  github-fs
@@ -2,8 +2,14 @@ command 'parse' do |c|
2
2
  c.syntax = 'brief parse PATH [OPTIONS]'
3
3
  c.description = 'parse the briefcase path'
4
4
 
5
- c.option '--output-type TYPE', String, 'Valid options: hash, array; Output as a hash keyed by path, or an array. Defaults to array.'
6
- c.option '--config-path FILE', String, 'Path to the config file for the briefcase'
5
+ c.option '--presenter-format FORMAT', String, 'Which presenter to use?'
6
+ c.option '--include-schema', 'Include schema information'
7
+ c.option '--include-models', 'Include individual models as well'
8
+ c.option '--include-content', 'Gets passed to the model renderers if present'
9
+ c.option '--include-rendered', 'Gets passed to the model renderers if present'
10
+ c.option '--include-urls', 'Gets passed to the model renderers if present'
11
+
12
+ c.example "Parsing an arbitrary selection of documents", "brief parse ./blueprint/docs/epics ./blueprint/docs/user_stories --root=./blueprint --format json --include-rendered --include-content"
7
13
 
8
14
  c.action do |args, options|
9
15
  options.default(root: Pathname(Brief.pwd), output_type: "array")
@@ -16,17 +22,32 @@ command 'parse' do |c|
16
22
 
17
23
  briefcase = Brief::Briefcase.new(o)
18
24
 
19
- parsed = if args.empty?
20
- briefcase.all_models.map do |model|
21
- model.as_json(content:true, rendered: true)
25
+ args.map! do |arg|
26
+ arg = Pathname(arg)
27
+
28
+ if arg.directory?
29
+ Dir[arg.join('**/*')].map {|f| Pathname(f) }
30
+ else
31
+ arg
22
32
  end
23
- else
24
- args.map do |a|
25
- Dir[briefcase.root.join(a)].map do |f|
26
- doc = Brief::Document.new(f).in_briefcase(briefcase)
27
- doc.to_model.as_json(content: true, rendered: true)
28
- end
29
- end.flatten
33
+ end
34
+
35
+ args.flatten!
36
+
37
+ args.select! {|arg| Brief::Util.ensure_child_path(briefcase.docs_path, arg) }
38
+ #args.map! {|arg| Brief::Document.new(arg.realpath).in_briefcase(briefcase) }
39
+
40
+ model_params = {
41
+ rendered: !!options.include_rendered,
42
+ content: !!options.include_content,
43
+ urls: !!options.include_urls
44
+ }
45
+
46
+ parsed = args.map do |path|
47
+ Brief::Document.new(path)
48
+ .in_briefcase(briefcase)
49
+ .to_model
50
+ .as_json(model_params)
30
51
  end
31
52
 
32
53
  if options.output_type == "hash"
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.9.1'
2
+ VERSION = '1.9.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brief
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-29 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie