brief 1.17.2 → 1.17.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: 3b638cef08e1dff8f273eb9a2469226eec7081ae
4
- data.tar.gz: 9dfc9513f0362669c981bd1f87ccee1779404ab0
3
+ metadata.gz: 869f116db5c6d3962d442661a8294a6a0cc72a34
4
+ data.tar.gz: 5739fedaf7311d1f6556cc237f7b6913ec239a78
5
5
  SHA512:
6
- metadata.gz: 76bd5b4128a815d0342ca3f506489bcdebdac6f33ee500aec666bf3f9d1e58fb695c91bffda19c58059addeab7f06c0c05cee0145b4ab9ac4bf860f60ccacb11
7
- data.tar.gz: 0cbf066475ad554603e7b129bb5c1829f2cf9cedf8cbd13231531316665f36d340ff203161ee804171b572b81ce2c6813f655d636c41c3b27f1a049f8b03503d
6
+ metadata.gz: c16af6687a3757d490f03e827f339fc851d7c348a1a51e91ad4d94b1e4a085bda6ae013010edfaa28fdf14ce665d95e1a482a0ab41c2f1a25c8268291370bbc5
7
+ data.tar.gz: 8641c113916f0cc31aadf6bc550328cc50ee97d55e8854a866799254694651a8911f5070626ad3de7b36872db26605f5fad48c91c7446c21da30de58deaca244
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.17.2)
4
+ brief (1.17.3)
5
5
  activesupport (> 3.2)
6
6
  commander (~> 4.3)
7
7
  em-websocket (~> 0.5)
@@ -0,0 +1,29 @@
1
+ class BlueprintReleasePublisher
2
+ def self.publish(epic, options={})
3
+ via = (options.fetch(:via, :github) || :github)
4
+
5
+ if respond_to?("publish_via_#{via}")
6
+ send("publish_via_#{via}", epic,options)
7
+ else
8
+ raise "Invalid publishing source. Need to implement publish_via_#{via} method"
9
+ end
10
+ end
11
+
12
+ def self.sync(epic, options={})
13
+ via = (options.fetch(:via, :github) || :github)
14
+
15
+ if respond_to?("sync_via_#{via}")
16
+ send("sync_via_#{via}", epic,options)
17
+ else
18
+ raise "Invalid syncing source. Need to implement sync_via_#{via} method"
19
+ end
20
+ end
21
+
22
+ def self.publish_via_pivotal(epic, options={})
23
+ raise "Not Implemented. Implement #{ name }.publish_via_pivotal"
24
+ end
25
+
26
+ def self.publish_via_github(epic, options={})
27
+ raise "Not Implemented. Implement #{ name }.publish_via_github"
28
+ end
29
+ end
@@ -1,5 +1,6 @@
1
1
  class Brief::Apps::Blueprint::Epic
2
2
  include Brief::Model
3
+ include Brief::RemoteSyncing
3
4
 
4
5
  defined_in Pathname(__FILE__)
5
6
 
@@ -61,6 +62,18 @@ class Brief::Apps::Blueprint::Epic
61
62
  briefcase.features(project: project, epic: title)
62
63
  end
63
64
 
65
+ def active?
66
+ status.to_s.downcase == "active"
67
+ end
68
+
69
+ def published?
70
+ status.to_s.downcase == "published"
71
+ end
72
+
73
+ def draft?
74
+ status.to_s.downcase == "draft" || status.to_s == ""
75
+ end
76
+
64
77
  def parent_project
65
78
  briefcase.projects(project: project).first
66
79
  end
@@ -80,13 +93,24 @@ class Brief::Apps::Blueprint::Epic
80
93
  end
81
94
  end
82
95
 
96
+ def generate_feature(feature_heading)
97
+ path = feature_file_for(feature_heading)
98
+ FileUtils.mkdir_p(path.dirname)
99
+
100
+ c = generate_feature_content(c)
101
+
102
+ path.open("w+") do |fh|
103
+ fh.write(c)
104
+ end
105
+ end
106
+
83
107
  def generate_feature_content(feature_heading)
84
108
  if feature_file_for(feature_heading).exist?
85
109
  return feature_file_for(feature_heading).read
86
110
  end
87
111
 
88
112
  data = {
89
- status: "published",
113
+ status: status,
90
114
  project: project,
91
115
  epic: title,
92
116
  title: feature_heading
@@ -1,5 +1,6 @@
1
1
  class Brief::Apps::Blueprint::Feature
2
2
  include Brief::Model
3
+ include Brief::RemoteSyncing
3
4
 
4
5
  defined_in Pathname(__FILE__)
5
6
 
@@ -27,11 +28,11 @@ class Brief::Apps::Blueprint::Feature
27
28
 
28
29
  actions do
29
30
  def publish
30
- BlueprintFeaturePublisher.publish(self, via: briefcase.settings.try(:tracking_system))
31
+ publish_service.publish(self, via: briefcase.settings.try(:tracking_system))
31
32
  end
32
33
 
33
34
  def sync
34
- BlueprintFeaturePublisher.sync(self, via: briefcase.settings.try(:tracking_system))
35
+ sync_service.sync(self, via: briefcase.settings.try(:tracking_system))
35
36
  end
36
37
  end
37
38
 
@@ -1,5 +1,6 @@
1
1
  class Brief::Apps::Blueprint::Milestone
2
2
  include Brief::Model
3
+ include Brief::RemoteSyncing
3
4
 
4
5
  defined_in Pathname(__FILE__)
5
6
 
@@ -21,11 +22,11 @@ class Brief::Apps::Blueprint::Milestone
21
22
 
22
23
  actions do
23
24
  def publish
24
- BlueprintMilestonePublisher.publish(self, via: briefcase.settings.try(:tracking_system))
25
+ publish_service.publish(self, via: briefcase.settings.try(:tracking_system))
25
26
  end
26
27
 
27
28
  def sync
28
- BlueprintMilestonePublisher.sync(self, via: briefcase.settings.try(:tracking_system))
29
+ sync_service.sync(self, via: briefcase.settings.try(:tracking_system))
29
30
  end
30
31
  end
31
32
  end
@@ -1,5 +1,6 @@
1
1
  class Brief::Apps::Blueprint::Project
2
2
  include Brief::Model
3
+ include Brief::RemoteSyncing
3
4
 
4
5
  defined_in Pathname(__FILE__)
5
6
 
@@ -18,11 +19,11 @@ class Brief::Apps::Blueprint::Project
18
19
 
19
20
  actions do
20
21
  def publish
21
- BlueprintProjectPublisher.publish(self, via: briefcase.settings.try(:tracking_system))
22
+ publish_service.publish(self, via: briefcase.settings.try(:tracking_system))
22
23
  end
23
24
 
24
25
  def sync
25
- BlueprintProjectPublisher.sync(self, via: briefcase.settings.try(:tracking_system))
26
+ sync_service.sync(self, via: briefcase.settings.try(:tracking_system))
26
27
  end
27
28
  end
28
29
 
@@ -1,15 +1,15 @@
1
1
  class Brief::Apps::Blueprint::Release
2
2
  include Brief::Model
3
+ include Brief::RemoteSyncing
3
4
 
4
5
  defined_in Pathname(__FILE__)
5
6
 
6
7
  meta do
7
8
  title
8
9
  status
9
- personas
10
10
  project
11
+ remote_id
11
12
  tags Array
12
- projects Array
13
13
  end
14
14
 
15
15
  content do
@@ -17,8 +17,8 @@ class Brief::Apps::Blueprint::Release
17
17
  paragraphs "p"
18
18
 
19
19
  title "h1:first-of-type", :hide => true
20
- tagline "h2:first-of-type", :hide => true
21
- yaml_data "code.yaml:first-of-type", :serialize => :yaml, :hide => true
20
+
21
+ settings "pre[lang='yaml'] code:first-of-type", :serialize => :yaml, :hide => true
22
22
 
23
23
  define_section "Features" do
24
24
  each("h2").has(:title => "h2",
@@ -27,4 +27,15 @@ class Brief::Apps::Blueprint::Release
27
27
  )
28
28
  end
29
29
  end
30
+
31
+ actions do
32
+ def publish
33
+ publish_service.publish(self, via: briefcase.settings.try(:tracking_system))
34
+ end
35
+
36
+ def sync
37
+ sync_service.sync(self, via: briefcase.settings.try(:tracking_system))
38
+ end
39
+ end
40
+
30
41
  end
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "brief"
5
+
6
+ require "pry"
7
+ Pry.start
data/lib/brief.rb CHANGED
@@ -149,6 +149,7 @@ require 'brief/model/definition'
149
149
  require 'brief/model/persistence'
150
150
  require 'brief/model/serializers'
151
151
  require 'brief/model/reports'
152
+ require 'brief/remote_syncing'
152
153
  require 'brief/data'
153
154
  require 'brief/dsl'
154
155
  require 'brief/server'
@@ -31,7 +31,7 @@ module Brief::Document::SourceMap
31
31
  superior && superior.element
32
32
  end
33
33
 
34
- def content_under_heading(heading_element, include_heading=true)
34
+ def line_numbers_for_heading(heading_element, include_heading=true)
35
35
  if heading_element.is_a?(String) && heading_element.length > 1
36
36
  heading_element = heading_element_tags.find do |el|
37
37
  el.attr('data-heading').include?(heading_element.strip.downcase) || el.text.to_s.strip.downcase.include?(heading_element.strip.downcase)
@@ -53,8 +53,12 @@ module Brief::Document::SourceMap
53
53
  end_index = end_index - start_index
54
54
  start_index = 0 if start_index < 0
55
55
 
56
- lines = raw_content.lines.dup.slice(start_index - 1, end_index)
56
+ [start_index, end_index]
57
+ end
57
58
 
59
+ def content_under_heading(heading_element, include_heading=true)
60
+ start_index, end_index = line_numbers_for_heading(heading_element, include_heading)
61
+ lines = raw_content.lines.dup.slice(start_index - 1, end_index)
58
62
  Array(include_heading ? lines : lines.slice(1, lines.length)).join("")
59
63
  end
60
64
  end
@@ -0,0 +1,17 @@
1
+ module Brief::RemoteSyncing
2
+ extend ActiveSupport::Concern
3
+
4
+ def publish_service
5
+ case
6
+ when briefcase && briefcase.uses_app?
7
+ [briefcase.app, self.class.name.to_s.split('::').last, 'publisher'].join("_").camelize.constantize
8
+ end
9
+ end
10
+
11
+ def sync_service
12
+ case
13
+ when briefcase && briefcase.uses_app?
14
+ [briefcase.app, self.class.name.to_s.split('::').last, 'publisher'].join("_").camelize.constantize
15
+ end
16
+ end
17
+ end
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.17.2'
2
+ VERSION = '1.17.3'
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.17.2
4
+ version: 1.17.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-07-02 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -296,6 +296,7 @@ email:
296
296
  - jonathan.soeder@gmail.com
297
297
  executables:
298
298
  - brief
299
+ - console
299
300
  extensions: []
300
301
  extra_rdoc_files: []
301
302
  files:
@@ -347,6 +348,7 @@ files:
347
348
  - apps/blueprint/lib/feature_publisher.rb
348
349
  - apps/blueprint/lib/milestone_publisher.rb
349
350
  - apps/blueprint/lib/project_publisher.rb
351
+ - apps/blueprint/lib/release_publisher.rb
350
352
  - apps/blueprint/models/concept.rb
351
353
  - apps/blueprint/models/diagram.rb
352
354
  - apps/blueprint/models/epic.rb
@@ -368,6 +370,7 @@ files:
368
370
  - apps/blueprint/templates/persona.md.erb
369
371
  - apps/blueprint/templates/user_story.md.erb
370
372
  - bin/brief
373
+ - bin/console
371
374
  - brief.gemspec
372
375
  - examples/blog/brief.rb
373
376
  - examples/blog/docs/posts/this-is-my-first-post.md
@@ -412,6 +415,7 @@ files:
412
415
  - lib/brief/model/persistence.rb
413
416
  - lib/brief/model/reports.rb
414
417
  - lib/brief/model/serializers.rb
418
+ - lib/brief/remote_syncing.rb
415
419
  - lib/brief/repository.rb
416
420
  - lib/brief/server.rb
417
421
  - lib/brief/server/gateway.rb