brief 1.14.2 → 1.14.3

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: c2f9aefc158045e46de1dc3cd657e65cf98957ac
4
- data.tar.gz: fb7dd822fe374ac2d4d4b3901b6a4c90a3ffac1d
3
+ metadata.gz: b274378ab543ef47fe650ee8e460b76b082ad923
4
+ data.tar.gz: e1a26dc9aeba6e4fa64c2435b604809a347b9bd1
5
5
  SHA512:
6
- metadata.gz: a1090116d3681c245bca064460081e1e5dfd34b5b75d62f3fca2c47b6cc1903dc47fe8042ed069f8666be9036a601abd040cece19d7798c0c8b507dcb3e4d923
7
- data.tar.gz: c54b89eef493fd0c70fea974be07ca5d109a083c0f35b1572c2fb7fd0c72a1f2429dc503ed4cf175b3b7bf0db4f00a87a3a3b721b25848a15352d8abc7517e93
6
+ metadata.gz: 6547e89d1f24d62e0bc6d169fff21b67c57c4862a2d8c134fd0e284c6c79fd8a24435f5a15a94f6d8ca4d43b2e65d4cf596817a3ce17a9ddb0e9a8166e537c87
7
+ data.tar.gz: 4439705a16ca9d2e49fc01e2666d07ca9ebe756e3901565f0776af49e918a0082cf1cd390181d795c0f688587c72e7df17884e2cded9fb6fe2d211fc26bf5954
@@ -17,6 +17,9 @@ config do
17
17
  set(:documentation_path, File.join(File.dirname(__FILE__), 'documentation'))
18
18
  end
19
19
 
20
+ command(:sync) do |*args|
21
+ end
22
+
20
23
  class Brief::Briefcase
21
24
  def has_table_of_contents?
22
25
  docs_path.join('index.md').exist?
@@ -25,6 +25,17 @@ module Brief
25
25
  @asset_finder = options.fetch(:asset_finder) { method(:find_asset) }
26
26
 
27
27
  Brief.cases[root.basename.to_s] ||= self
28
+
29
+ load_lib_entries()
30
+ end
31
+
32
+ def load_lib_entries
33
+ begin
34
+ etc = Dir[briefcase_lib_path.join("**/*.rb")]
35
+ etc.each {|f| require(f) } if briefcase_lib_path.exist?
36
+ rescue
37
+
38
+ end
28
39
  end
29
40
 
30
41
  # Runs a command
@@ -43,6 +54,11 @@ module Brief
43
54
  end
44
55
  end
45
56
 
57
+ # runs a command but does not raise an error
58
+ def run_command!(name, *args)
59
+ run_command(name, *args) rescue nil
60
+ end
61
+
46
62
  # Returns a Hash object which presents some
47
63
  # view of the briefcase. Accepts a params hash
48
64
  # of options that will be passed to the presenter.
@@ -91,7 +107,8 @@ module Brief
91
107
  docs_path: docs_path.to_s,
92
108
  assets_path: assets_path.to_s,
93
109
  models_path: models_path.to_s,
94
- data_path: data_path.to_s
110
+ data_path: data_path.to_s,
111
+ lib_path: briefcase_lib_path.to_s
95
112
  }
96
113
  }
97
114
  end
@@ -275,6 +292,10 @@ module Brief
275
292
  root.join(options.fetch(:data_path) { config.data_path }).expand_path
276
293
  end
277
294
 
295
+ def briefcase_lib_path
296
+ root.join(options.fetch(:lib_path) { config.lib_path }).expand_path
297
+ end
298
+
278
299
  def assets_trail
279
300
  @assets_trail ||= Hike::Trail.new(assets_path).tap do |trail|
280
301
  trail.append_extensions '.svg', '.png', '.pdf', '.jpg', '.gif', '.mov'
@@ -18,7 +18,8 @@ module Brief
18
18
  models_path: 'models',
19
19
  templates_path: 'templates',
20
20
  data_path: 'data',
21
- assets_path: 'assets'
21
+ assets_path: 'assets',
22
+ lib_path: "lib"
22
23
  }.to_mash
23
24
  end
24
25
 
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.14.2'
2
+ VERSION = '1.14.3'
3
3
  end
@@ -0,0 +1,3 @@
1
+ class ShouldBeDefined
2
+
3
+ end
@@ -1,5 +1,12 @@
1
1
  require "spec_helper"
2
2
 
3
+ module Middleman
4
+ class Extension
5
+ def self.method_missing(*args); end
6
+ def method_missing(*args); end
7
+ end
8
+ end
9
+
3
10
  describe "Packaged Apps" do
4
11
  let(:sample) do
5
12
  Brief::Briefcase.new(app: "sample")
@@ -19,11 +19,19 @@ describe "The Briefcase" do
19
19
  expect(briefcase.settings).not_to be_empty
20
20
  end
21
21
 
22
+ # TODO
23
+ # This is dependent on the blueprint app
24
+ # should be refactored
22
25
  it "has a table of contents" do
23
26
  expect(briefcase.table_of_contents).to be_present
24
27
  expect(briefcase.table_of_contents.headings).not_to be_empty
25
28
  end
26
29
 
30
+ it "loads the files defined in the lib folder" do
31
+ expect(briefcase.briefcase_lib_path.entries).not_to be_empty
32
+ expect(defined?(ShouldBeDefined)).to be_truthy
33
+ end
34
+
27
35
  it "points to a file repository" do
28
36
  expect(briefcase.repository).to be_a(Brief::Repository)
29
37
  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.14.2
4
+ version: 1.14.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-06-22 00:00:00.000000000 Z
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -440,6 +440,7 @@ files:
440
440
  - spec/fixtures/example/docs/resource.html.md
441
441
  - spec/fixtures/example/docs/user_story.html.md
442
442
  - spec/fixtures/example/docs/wireframe.html.md
443
+ - spec/fixtures/example/lib/should_be_defined.rb
443
444
  - spec/fixtures/example/models/concept.rb
444
445
  - spec/fixtures/example/models/epic.rb
445
446
  - spec/fixtures/example/models/page.rb
@@ -540,6 +541,7 @@ test_files:
540
541
  - spec/fixtures/example/docs/resource.html.md
541
542
  - spec/fixtures/example/docs/user_story.html.md
542
543
  - spec/fixtures/example/docs/wireframe.html.md
544
+ - spec/fixtures/example/lib/should_be_defined.rb
543
545
  - spec/fixtures/example/models/concept.rb
544
546
  - spec/fixtures/example/models/epic.rb
545
547
  - spec/fixtures/example/models/page.rb