brief 1.17.8 → 1.17.9

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: 6223ddc5e49e8b10705b2e49d4af87b7c4e1756b
4
- data.tar.gz: e4529fb4e36a92d98d89113eea374b2d7cb7fa86
3
+ metadata.gz: faf6fee908cd26f6c56e6b7666a69a54cdd485c4
4
+ data.tar.gz: 601462587977651e9c5836442448cc18a71030b9
5
5
  SHA512:
6
- metadata.gz: cf1fad8bdb60cd3cb8728ba8e04b071bf1cc91e28e5bdd090acf37ef8640f1d088f1fecf9b7f20fe496053185df0f0915f189933bf903c5f56d73aacb08d825b
7
- data.tar.gz: b30b5ca51aea644c9136b30850d02cf7942dadf23838e2f2f87116ebf40c707ae8ef52d1d9b10c343daef03be9717ada410da303a7afe47b7cd758d06c0a0fd8
6
+ metadata.gz: 07b3796eecb3fa04b0368696d0dc83e337af1e9b0c4d037d13bb10e23f228330e9dbc85158eb3f107dff2c3479ab88e7b9c75c0bac3740a69a665f1a9bac2085
7
+ data.tar.gz: 538b9687ac9dbe8b1a240fee5484ab417347c802b9a7e37c8f0e1886b397eeda94d4eb01a11c10c404c718cc44a090a28195bb38f785dfe735deea308fb9c9e8
@@ -55,6 +55,24 @@ class Brief::Apps::Blueprint::Epic
55
55
  def publish
56
56
  BlueprintEpicPublisher.publish(self, via: briefcase.settings.try(:tracking_system))
57
57
  end
58
+
59
+ # Converts a draft epic which contains inline feature definitions
60
+ # into individual feature files
61
+ def featurize
62
+ puts "== Generating features for #{ title }"
63
+
64
+ features_data.each do |feature|
65
+ puts " -- #{ feature.title }"
66
+
67
+ begin
68
+ generate_feature(feature.title) if feature.title
69
+ rescue => e
70
+ puts "Error generating feature: #{ feature.title } #{ e.message }".red
71
+ end
72
+ end
73
+
74
+ nil
75
+ end
58
76
  end
59
77
 
60
78
  helpers do
@@ -137,7 +155,7 @@ class Brief::Apps::Blueprint::Epic
137
155
  # UGLY
138
156
  # Promotes the h2 heading to an h1 for this document
139
157
  v.gsub! "## #{ feature_heading }", "# #{ feature_heading }"
140
- v.gsub! "###{ feature_heading }", "##{ feature_heading }"
158
+ v.gsub! "###{ feature_heading }", "# #{ feature_heading }"
141
159
  end
142
160
  end
143
161
 
@@ -216,5 +234,35 @@ class Brief::Apps::Blueprint::Epic
216
234
  errors.each {|w| puts " -- #{ w }" }
217
235
  end
218
236
  end
237
+
238
+ def github_issue_body
239
+ replace_feature_content_with_issue_links
240
+ end
241
+
242
+ def github_issue_title
243
+ title
244
+ end
245
+
246
+ def replace_feature_content_with_issue_links
247
+ content
248
+ end
249
+
250
+ def github_issue_labels
251
+ []
252
+ end
253
+
254
+ def github_milestone_number
255
+ nil
256
+ end
257
+
258
+ def github_issue_attributes
259
+ {
260
+ title: github_issue_title,
261
+ body: github_issue_body,
262
+ labels: github_issue_labels,
263
+ milestone: github_milestone_number
264
+ }
265
+ end
266
+
219
267
  end
220
268
  end
data/lib/brief/data.rb CHANGED
@@ -23,7 +23,14 @@ module Brief
23
23
  @sources = {}.to_mash
24
24
 
25
25
  load_files.each do |source, data|
26
- @sources[source] = Queryable.new(data)
26
+ if data.is_a?(Hash)
27
+ @sources[source] = data.keys.inject({}.to_mash) do |memo, key|
28
+ memo[key] = Queryable.new(data[key])
29
+ memo
30
+ end
31
+ elsif data.is_a?(Array)
32
+ @sources[source] = Queryable.new(data)
33
+ end
27
34
  end
28
35
  end
29
36
 
@@ -97,6 +97,11 @@ module Brief
97
97
  true
98
98
  end
99
99
 
100
+ def refreshed
101
+ refresh!
102
+ self
103
+ end
104
+
100
105
  def save!
101
106
  if set_raw?
102
107
  file_contents = raw_content
@@ -19,6 +19,15 @@ module Brief
19
19
  module Rendering
20
20
  extend ActiveSupport::Concern
21
21
 
22
+ module ClassMethods
23
+ def render_gfm(content)
24
+ html = Github::Markdown.render_pure_gfm(content)
25
+ fragment = Nokogiri::HTML.fragment(html)
26
+ fragment.css("p br").remove
27
+ fragment.to_html
28
+ end
29
+ end
30
+
22
31
  def script_preamble
23
32
  <<-EOF
24
33
  <script type="text/javascript">
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.8
4
+ version: 1.17.9
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-06 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie