brief 1.8.2 → 1.8.3

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: 212044b48f259296e12c057ec7d87d9e04b3d238
4
- data.tar.gz: edea3d30a403388bdb0c47bdedc9074464a00c5a
3
+ metadata.gz: be0eef8f655a9b9d5ebe02b3b718ddc36d380bb5
4
+ data.tar.gz: 2926731279f53b37faa4c905839fca50df24673b
5
5
  SHA512:
6
- metadata.gz: 8539037809b1f7ee53c640b2443fb5803c4e45a512845b2f7551d9991725257c891c49afa585d6c664b946730bc0b8b5b85ed0ee09d43bd6ac3a29913d64b26b
7
- data.tar.gz: 1950386d35ab9f66e60dce58d1998b0166973c15dd957c8c77e4bbe55a21d198c040eee95bc3601cecac6abc887e8ce19dce62320b20cd530ea3da6d499eaac8
6
+ metadata.gz: 088bf02d1b3cb7399e8a43729da51bb7a42be252ecce8c2ccf704f6e467d00c206d7dcdab579711642bcda7459c3cde624ba8c1007792ce8a2fc643e13d83fe3
7
+ data.tar.gz: 3e694d6d1114e770ad4792f6e6b685b502340b5d7a8d594213447c0154630e5851184b88624f81fdd4cff4f08c68e1931e3bb46376dc1e131c40d0ea1b4f7ae5
data/CHANGELOG.md CHANGED
@@ -125,3 +125,7 @@ attributes.
125
125
  ### 1.6.0
126
126
  - Introducing the apps repository for shared model code
127
127
  - Added capability to pull out yaml blocks from the document as deserialized hashes on our models
128
+
129
+ ### 1.8.3
130
+ - General improvements to models & documents api
131
+ - Added support for cache key
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.8.2)
4
+ brief (1.8.3)
5
5
  activemodel
6
6
  activesupport (>= 4.0)
7
7
  commander (>= 4.2.1)
@@ -89,7 +89,7 @@ GEM
89
89
  thread_safe (0.3.5)
90
90
  tzinfo (1.2.2)
91
91
  thread_safe (~> 0.1)
92
- virtus (1.0.4)
92
+ virtus (1.0.5)
93
93
  axiom-types (~> 0.1)
94
94
  coercible (~> 1.0)
95
95
  descendants_tracker (~> 0.0, >= 0.0.3)
@@ -0,0 +1,22 @@
1
+ class Brief::Apps::Blueprint::Diagram
2
+ include Brief::Model
3
+
4
+ meta do
5
+ title
6
+ subheading
7
+ status String, :in => "draft published"
8
+ end
9
+
10
+ content do
11
+ title "h1:first-of-type"
12
+
13
+ subheading "h2:first-of-type"
14
+
15
+ define_section "Annotations" do
16
+ each("h2").has(:title => "h3",
17
+ :paragraphs => "p",
18
+ :settings => "code")
19
+ end
20
+ end
21
+ end
22
+
@@ -0,0 +1,16 @@
1
+ class Brief::Apps::Blueprint::Milestones
2
+ include Brief::Model
3
+
4
+ meta do
5
+ title
6
+ number
7
+ due_date
8
+ end
9
+
10
+ content do
11
+ title "h1:first-of-type", :hide => true
12
+ paragraph "p:first-of-type"
13
+ paragraphs "p"
14
+ yaml_data "code.yaml:first-of-type", :serialize => :yaml, :hide => true
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class Brief::Apps::Blueprint::Project
2
+ include Brief::Model
3
+
4
+ meta do
5
+ title
6
+ category
7
+ tags Array
8
+ end
9
+
10
+ content do
11
+ paragraph "p:first-of-type"
12
+ title "h1:first-of-type", :hide => true
13
+ tagline "h2:first-of-type", :hide => true
14
+ yaml_data "code.yaml:first-of-type", :serialize => :yaml, :hide => true
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ class Brief::Apps::Blueprint::Release
2
+ include Brief::Model
3
+
4
+ meta do
5
+ title
6
+ status
7
+ tags Array
8
+ end
9
+
10
+ content do
11
+ paragraph "p:first-of-type"
12
+ paragraps "p"
13
+ title "h1:first-of-type", :hide => true
14
+ tagline "h2:first-of-type", :hide => true
15
+ yaml_data "code.yaml:first-of-type", :serialize => :yaml, :hide => true
16
+
17
+ define_section "User Stories" do
18
+ each("h2").has(:title => "h2",
19
+ :paragraph => "p:first-of-type",
20
+ :components => "p:first-of-type strong"
21
+ )
22
+ end
23
+ end
24
+ end
@@ -29,6 +29,14 @@ module Brief
29
29
  end
30
30
  end
31
31
 
32
+ def cache_key
33
+ "#{slug}:#{repository.cache_key}"
34
+ end
35
+
36
+ def slug
37
+ options.fetch(:slug) { root.basename.to_s.parameterize }
38
+ end
39
+
32
40
  def settings
33
41
  @settings ||= settings!
34
42
  end
@@ -64,7 +72,8 @@ module Brief
64
72
  name: briefcase.folder_name.to_s.titlecase,
65
73
  schema: schema,
66
74
  models: models,
67
- settings: settings
75
+ settings: settings,
76
+ cache_key: briefcase.cache_key
68
77
  }
69
78
  end
70
79
 
@@ -12,10 +12,10 @@ command 'export' do |c|
12
12
 
13
13
  briefcase = Brief::Briefcase.new(config_path: Pathname(options.config_path))
14
14
 
15
- json = briefcase.present("default", content: !!options.include_content, rendered: !!options.include_rendered)
15
+ dump = briefcase.as_full_export()
16
16
 
17
- output = args.first || "briefcase.json"
17
+ output = args.first || "#{ briefcase.cache_key }.json"
18
18
 
19
- Pathname(Dir.pwd).join(output).open("w+") {|fh| fh.write(json.to_json) }
19
+ Pathname(Dir.pwd).join(output).open("w+") {|fh| fh.write(dump.to_json) }
20
20
  end
21
21
  end
@@ -16,6 +16,10 @@ module Brief
16
16
  load_documents
17
17
  end
18
18
 
19
+ def cache_key
20
+ "#{documents.count}-#{documents.map {|d| d.path.mtime.to_i }.max}"
21
+ end
22
+
19
23
  def respond_to?(meth)
20
24
  super || model_groups.include?(meth.to_s)
21
25
  end
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.8.2'
2
+ VERSION = '1.8.3'
3
3
  end
@@ -3,7 +3,7 @@ type: concept
3
3
 
4
4
  ---
5
5
 
6
- # Modified Content pdgvx3vvbqibhn1sqgljkllwgjnog1io7rkl
6
+ # Modified Content nafl3xeddhzqwa9mev1me356ijxighwm1jg1
7
7
 
8
8
  1
9
9
 
@@ -7,6 +7,14 @@ describe "The Briefcase" do
7
7
  expect(briefcase.root).to be_exist
8
8
  end
9
9
 
10
+ it "has a cache key" do
11
+ expect(briefcase.cache_key).not_to be_nil
12
+ end
13
+
14
+ it "has a slug" do
15
+ expect(briefcase.slug).to eq("example")
16
+ end
17
+
10
18
  it "points to a file repository" do
11
19
  expect(briefcase.repository).to be_a(Brief::Repository)
12
20
  end
File without changes
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.8.2
4
+ version: 1.8.3
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-17 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -238,9 +238,13 @@ files:
238
238
  - Rakefile
239
239
  - TUTORIAL.md
240
240
  - apps/blueprint/config.rb
241
+ - apps/blueprint/models/diagram.rb
241
242
  - apps/blueprint/models/epic.rb
243
+ - apps/blueprint/models/milestone.rb
242
244
  - apps/blueprint/models/page.rb
243
245
  - apps/blueprint/models/persona.rb
246
+ - apps/blueprint/models/project.rb
247
+ - apps/blueprint/models/release.rb
244
248
  - apps/blueprint/models/user_story.rb
245
249
  - apps/blueprint/models/wireframe.rb
246
250
  - bin/brief
@@ -320,6 +324,7 @@ files:
320
324
  - spec/lib/brief/dsl_spec.rb
321
325
  - spec/lib/brief/hashing_spec.rb
322
326
  - spec/lib/brief/model_spec.rb
327
+ - spec/lib/brief/models/diagram_spec.rb
323
328
  - spec/lib/brief/models/page_spec.rb
324
329
  - spec/lib/brief/models/release_spec.rb
325
330
  - spec/lib/brief/persistence_spec.rb
@@ -399,6 +404,7 @@ test_files:
399
404
  - spec/lib/brief/dsl_spec.rb
400
405
  - spec/lib/brief/hashing_spec.rb
401
406
  - spec/lib/brief/model_spec.rb
407
+ - spec/lib/brief/models/diagram_spec.rb
402
408
  - spec/lib/brief/models/page_spec.rb
403
409
  - spec/lib/brief/models/release_spec.rb
404
410
  - spec/lib/brief/persistence_spec.rb