brief 1.5.1 → 1.5.2

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: 2bff2a020e24fc30bab2b5b93c854ec96c70d3af
4
- data.tar.gz: 711b3c62cdb58b3c67d4acb2ca7e3d2298305182
3
+ metadata.gz: f1e4078f005e4ba5a99b045a245a897ca71683dc
4
+ data.tar.gz: d810cae63f5c24786b5a48b4af515b33a3fdf36c
5
5
  SHA512:
6
- metadata.gz: f118758e7e59399b8b0dd438bf226943d2ed2ff84f2f2f5941f8a64a5f23d32d192684ab82c8db6f7aa2280f764a159a5415826d25ffe5c73c109bf6d092091d
7
- data.tar.gz: 457b6b9cd33a3a3597dd1f728a97bd4198fc0a6faa7054a67fae45e431c771e3cabf7da060a932707b8799fbb9d24c9f5c9a0cbfc8e9a15540dd9d2eeda62d43
6
+ metadata.gz: 833e064d7b2aa8d619c5c8fce6a9bc401c3b4a070f71f1e75f41053d22fb7dd22d533403a82ad76ac8341b50cdd914ad989529c848b6d33c97dc3dfcbee12e18
7
+ data.tar.gz: 679d1d73a557be8df6a4a0891506cce9c2bc17510bb2db44d8fb1a53988847133d45fde71586cff46d2a4e895dcd6df31e59729bd28b373be848fa78ade9608f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.5.0)
4
+ brief (1.5.1)
5
5
  activemodel
6
6
  activesupport
7
7
  commander
@@ -52,6 +52,17 @@ module Brief
52
52
  end
53
53
 
54
54
  path.open('w') {|fh| fh.write(file_contents) }
55
+ refresh!
56
+ end
57
+
58
+ def refresh!
59
+ @content = nil
60
+ @raw_content = path.read
61
+ @frontmatter = nil
62
+ @raw_frontmatter = nil
63
+ @refreshing = true
64
+ load_frontmatter
65
+ true
55
66
  end
56
67
 
57
68
  def save!
@@ -62,6 +73,7 @@ module Brief
62
73
  end
63
74
 
64
75
  path.open('w+') {|fh| fh.write(file_contents) }
76
+ refresh!
65
77
  end
66
78
 
67
79
  def combined_data_and_content
@@ -15,6 +15,7 @@ module Brief::Model::Serializers
15
15
  extracted: extracted_content_data,
16
16
  path: path.to_s,
17
17
  type: type,
18
+ group: type.to_s.pluralize,
18
19
  title: title,
19
20
  actions: self.class.defined_actions,
20
21
  urls: {
@@ -74,7 +74,7 @@ module Brief
74
74
  end
75
75
 
76
76
  def all_models
77
- list = documents.map(&:to_model)
77
+ list = documents.select(&:refresh!).map(&:to_model)
78
78
  list.compact!
79
79
  list.select!(&:exists?)
80
80
 
@@ -1,7 +1,6 @@
1
1
  module Brief::Server::Handlers
2
2
  class Browse
3
3
  def self.handle(path_args, briefcase, options={})
4
- briefcase.purge(path_args)
5
4
  models = Array((briefcase.send(path_args) rescue nil))
6
5
  [200, {"Content-Type"=>"application/json"}, models.map(&:as_json)]
7
6
  end
@@ -69,7 +69,7 @@ module Brief::Server::Handlers
69
69
  document.save!
70
70
  end
71
71
 
72
- doc.to_model
72
+ doc.to_model.as_json(content: true, rendered: true)
73
73
  end
74
74
 
75
75
  def remove
@@ -102,7 +102,7 @@ module Brief::Server::Handlers
102
102
 
103
103
  document.save
104
104
 
105
- document.to_model
105
+ document.to_model.as_json(content: true, rendered: true)
106
106
  end
107
107
  end
108
108
 
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.5.1'
2
+ VERSION = '1.5.2'
3
3
  end
@@ -49,7 +49,6 @@ describe "Modifying Documents", :type => :request do
49
49
  needle = rand(36**36).to_s(36)
50
50
  post "/update/concept.html.md", content: "# Modified Content #{ needle }", data: {needle: needle}
51
51
  get("/browse/concepts")
52
-
53
52
  needles = json.map {|h| h["data"]["needle"] }
54
53
  expect(needles).to include(needle)
55
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brief
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder