brief 1.11.5 → 1.11.6

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: 38fdd7c93772bcfc613fcf91c68a7473d46e52fc
4
- data.tar.gz: 157873b94414f9560e862b0551800243665519d8
3
+ metadata.gz: c777abc6c9fd2ef3ac8b46e526ea2ca0ad8dab05
4
+ data.tar.gz: a334054f14e1227ce91bff94e1cdd7b4a7339c47
5
5
  SHA512:
6
- metadata.gz: 9f8ad4c6c40af589138a012d82efc2d08999b6923cb43e7b2833d3113386752b45f82f8db282b21c2d96978b9afd55c2c75a13127522494a2b5d0ee5001e6af4
7
- data.tar.gz: 3e96c0094a9b7cd5c3abe1b21668ab00dff6d2ed37535b0931babe7b540d455eeef6f25489325d72f0172306502c659e1ed044da505d39b827355739011156e6
6
+ metadata.gz: 4ecf27b3d5f36288b54bd0cbd7a4dc142a95dacc22e0afc315f04141aed26e9e22fa0f7c62dce4bf1e57218fd023d1cacc5a5a78f148afc3871147cea756e3d7
7
+ data.tar.gz: 20fa631cc45a9bbf33f51ecd97f1b001904eab11817dc0f376a2b5df2d47e196951bc07d1d65fa5228883758ba277949c364bdf5cf8cdaaf333cbc6ae09053b4
data/Dockerfile ADDED
@@ -0,0 +1,12 @@
1
+ FROM ruby:2.2.2
2
+ RUN useradd -m -d /home/ruby -p ruby ruby && adduser ruby sudo && chsh -s /bin/bash ruby
3
+
4
+ ENV HOME /home/ruby
5
+ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
6
+
7
+ RUN mkdir /briefcases && chown ruby:ruby /briefcases /usr/local/bundle
8
+
9
+ WORKDIR /home/ruby
10
+ RUN gem install bundler datapimp brief
11
+ RUN brief start socket server --root /briefcases
12
+ EXPOSE 9094
data/README.md CHANGED
@@ -138,6 +138,19 @@ You can use an `app` by saying so in your config file:
138
138
  use "blueprint" # => $BRIEF_GEM/apps/blueprint
139
139
  ```
140
140
 
141
+ This will give you access to all of the models and document types from
142
+ that app.
143
+
144
+ #### Creating your own app
145
+
146
+ ```bash
147
+ brief help create app
148
+ brief create app cookbook # => $HOME/.brief/apps/cookbook
149
+ ```
150
+
151
+ This will let you start defining models, and then re-using this app
152
+ across different writing projects.
153
+
141
154
  ## Other neat features (TODO)
142
155
 
143
156
  ### Special Link & Image Tags
data/ROADMAP.md ADDED
@@ -0,0 +1,14 @@
1
+ # Roadmap
2
+
3
+ ### Revisit App Structure
4
+
5
+ Why not follow conventional rails organization?
6
+
7
+ - app
8
+ - models/
9
+ - views/
10
+ - editors/
11
+ - bin
12
+ - config
13
+ - documents
14
+ - export
@@ -0,0 +1,16 @@
1
+ # Software Blueprint
2
+
3
+ Why are you building what you are building, and how you will measure
4
+ whether it is successful? Which projects are required to accomplish the
5
+ overall vision, and how will they relate to one another? What are the core
6
+ concepts of the domain? How will the information be organized? What are
7
+ the different screens that need to be developed, and how should actions
8
+ taken on these screens be relayed to a database or an API?
9
+
10
+ Developing a successful software project with a team of designers,
11
+ developers, marketers, and project managers requires maintaining an attention to
12
+ detail as well as clarity and alignment on the big picture. And it
13
+ requires this over a long period of time, as things change and evolve,
14
+ and as members of the team come and go.
15
+
16
+ Consider this a living guide for your software project, telling you where you are today, how you got here, and where you are going next month and how you will get there.
data/brief.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'hashie', '>= 3.0.4'
22
22
  spec.add_dependency 'commander', '~> 4.3'
23
+ spec.add_dependency 'terminal-table'
23
24
  spec.add_dependency 'github-fs', '~> 0'
24
25
  spec.add_dependency 'virtus', '~> 1.0'
25
26
  spec.add_dependency 'inflecto', '~> 0'
data/lib/brief/apps.rb CHANGED
@@ -11,6 +11,8 @@ module Brief
11
11
  def self.search_paths
12
12
  paths = [default_path]
13
13
 
14
+ paths << home_apps_path if home_apps_path.exist?
15
+
14
16
  if custom_path = ENV['BRIEF_APPS_PATH']
15
17
  custom_path = custom_path.to_s.to_pathname
16
18
  paths << custom_path if (custom_path.exist? rescue nil)
@@ -82,7 +82,7 @@ module Brief
82
82
  end
83
83
 
84
84
  if params[:include_schema] || params[:schema]
85
- base[:schema] = schema_map
85
+ base[:schema] = schema_map(!!(params[:include_schema] == "full"))
86
86
  end
87
87
 
88
88
  if params[:include_documentation] || params[:documentation]
@@ -4,7 +4,7 @@ module Brief
4
4
 
5
5
  class ModelDoc
6
6
  def initialize(path)
7
- @content = Pathname(path).read
7
+ @content = Pathname(path).read rescue ""
8
8
  end
9
9
 
10
10
  def content
@@ -1,3 +1,18 @@
1
+ command 'browse apps' do |c|
2
+ c.syntax = "brief browse apps"
3
+ c.description = "browse the available apps"
4
+
5
+ c.action do |args, options|
6
+ require 'terminal-table'
7
+ rows = Brief::Apps.app_paths.map do |folder|
8
+ [folder.basename, folder.to_s]
9
+ end
10
+
11
+ table = Terminal::Table.new(:rows => rows, :headings => %w(Name Found-In-Path))
12
+ puts table
13
+ end
14
+ end
15
+
1
16
  command 'browse documents' do |c|
2
17
  c.syntax = 'brief browse documents PATHS [OPTIONS]'
3
18
  c.description = 'browse documents in the briefcase path'
@@ -5,17 +5,76 @@ command "create app" do |c|
5
5
  c.option '--clone EXISTING_APP', String, 'Clone an existing app'
6
6
 
7
7
  c.action do |args, options|
8
- name = args.first
8
+ name = args.first.to_s
9
+ raise 'Must specify a name for your app' unless name.length > 0
10
+
11
+ folder = Brief::Apps.home_apps_path.join(name.downcase)
12
+
13
+ if folder.exist?
14
+ raise 'An app with this name already exists'
15
+ end
16
+
17
+ FileUtils.mkdir_p(folder)
18
+
19
+ if options.clone && Brief::Apps.available?(options.clone.downcase.to_s)
20
+ puts "== Cloning #{ options.clone.downcase }"
21
+ FileUtils.cp_r(Brief::Apps.path_for(options.clone.downcase.to_s), Brief::Apps.home_apps_path.join(name.downcase))
22
+ else
23
+ %w(models examples documentation).each do |subfolder|
24
+ FileUtils.mkdir_p folder.join(subfolder)
25
+ end
26
+
27
+ folder.join("config.rb").open("w+") do |fh|
28
+ fh.write("config do\n set(:documentation_path, File.join(File.dirname(__FILE__),'documentation'))\nend")
29
+ end
30
+
31
+ puts "== Created app #{ name }"
32
+ end
9
33
  end
10
34
  end
11
35
 
12
36
  command "create briefcase" do |c|
13
- c.syntax = "brief create app PATH"
37
+ c.syntax = "brief create briefcase PATH"
14
38
  c.description = "create a new briefcase"
15
39
 
16
40
  c.option '--app APP_NAME', String, 'Use the specified app'
17
41
  c.option '--use-local-models', nil, 'When using an app, this option will copy over the models locally instead, so you can customize them.'
42
+ c.option '--force', nil, 'Required if PATH already exists'
18
43
 
19
44
  c.action do |args, options|
45
+ arg = args.first || "./briefcase"
46
+
47
+ folder = Pathname(arg)
48
+
49
+ if !options.force && folder.exist?
50
+ raise 'Folder already exists. Pass --force to continue'
51
+ end
52
+
53
+ FileUtils.mkdir_p(folder)
54
+
55
+ folder.join("config.rb").open("w+") do |fh|
56
+ fh.write("config do\n set(:models_path, \"./models\") \nend")
57
+ end
58
+
59
+ case
60
+ when options.app && options.use_local_models
61
+ folder.join("brief.rb").open("a") do |fh|
62
+ fh.write "\nuse #{ options.app }"
63
+ end
64
+
65
+ models_path = Brief::Apps.path_for(options.app).join("models")
66
+ FileUtils.cp_r(models_path, folder)
67
+
68
+ when options.app
69
+ folder.join("brief.rb").open("a") do |fh|
70
+ fh.write "\nuse #{ options.app }"
71
+ end
72
+ end
73
+
74
+ %w(docs assets data models).each do |subfolder|
75
+ FileUtils.mkdir_p folder.join(subfolder)
76
+ end
77
+
78
+ puts "Created briefcase in #{ folder }"
20
79
  end
21
80
  end
@@ -0,0 +1,14 @@
1
+ command "show app" do |c|
2
+ c.syntax = "brief edit app NAME"
3
+ c.description = "edit a brief app"
4
+
5
+ c.action do |args, options|
6
+ app = args.first.to_s.downcase
7
+
8
+ if Brief::Apps.available?(app)
9
+ puts "#{ Brief::Apps.path_for(app) }"
10
+ end
11
+ end
12
+ end
13
+
14
+
@@ -2,10 +2,10 @@ command 'schema' do |c|
2
2
  c.syntax = "brief schema"
3
3
  c.description = "view information about the schema"
4
4
 
5
- c.option '--all-models', 'Include all models, not just those that have documents'
5
+ c.option '--existing-models', 'Include all models, not just those that have documents'
6
6
 
7
7
  c.action do |args, options|
8
- schema_map = Brief.case(true).schema_map(options.all_models)
8
+ schema_map = Brief.case(true).schema_map(!!!options.existing_models)
9
9
 
10
10
  output = if args.empty?
11
11
  schema_map.to_json
@@ -1,4 +1,4 @@
1
- command 'start gateway server' do |c|
1
+ command 'start server' do |c|
2
2
  c.option '--host HOSTNAME', nil, 'What hostname to listen on'
3
3
  c.option '--port PORT', nil, 'What port to listen on'
4
4
 
@@ -8,7 +8,19 @@ command 'start gateway server' do |c|
8
8
  require 'thin'
9
9
  require 'rack/handler/thin'
10
10
  require 'brief/server/gateway'
11
- Brief::Server::Gateway.start(port: options.port, host: options.host, root: Pathname(options.root))
11
+ require 'brief/server/socket'
12
+ require 'em-websocket'
13
+
14
+ fork do
15
+ Brief::Server::Gateway.start(port: options.port, host: options.host, root: Pathname(options.root))
16
+ end
17
+
18
+ EM.run {
19
+ EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws|
20
+ Brief::Server::Socket.new(root: options.root, websocket: ws)
21
+ end
22
+ }
23
+
12
24
  end
13
25
  end
14
26
 
@@ -21,7 +33,6 @@ command 'start socket server' do |c|
21
33
  require 'brief/server/socket'
22
34
  require 'em-websocket'
23
35
 
24
-
25
36
  EM.run {
26
37
  EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws|
27
38
  Brief::Server::Socket.new(root: options.root, websocket: ws)
data/lib/brief/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brief
2
- VERSION = '1.11.5'
2
+ VERSION = '1.11.6'
3
3
  end
@@ -0,0 +1,12 @@
1
+ FROM ruby:2.2.2
2
+ RUN useradd -m -d /home/ruby -p ruby ruby && adduser ruby sudo && chsh -s /bin/bash ruby
3
+
4
+ ENV HOME /home/ruby
5
+ ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
6
+
7
+ RUN mkdir /briefcases && chown ruby:ruby /briefcases /usr/local/bundle
8
+
9
+ WORKDIR /home/ruby
10
+ RUN gem install bundler datapimp brief
11
+ EXPOSE 8089
12
+
@@ -12,3 +12,29 @@ class Brief::Page
12
12
  yaml "pre[lang='yaml'] code", :serialize => :yaml
13
13
  end
14
14
  end
15
+
16
+ __END__
17
+
18
+ @@ example
19
+ ---
20
+ type: page
21
+ title: Example Page
22
+ ---
23
+
24
+ # This is the title of the page
25
+
26
+ this is the first paragraph
27
+
28
+ ## other heading
29
+
30
+ below is some yaml. you can embed data under a heading, if it is relevant to that heading.
31
+
32
+ ```yaml
33
+ setting: value
34
+ ```
35
+
36
+ @@ template
37
+
38
+ <% if object.title %>
39
+ # <%= object.title %>
40
+ <% end %>
@@ -15,5 +15,6 @@ describe "The Page Document Type" do
15
15
  expect(page.extracted_content_data.title).to eq("Summary")
16
16
  expect(page.extracted_content_data.paragraph).not_to be_nil
17
17
  end
18
+
18
19
  end
19
20
 
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.11.5
4
+ version: 1.11.6
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-04 00:00:00.000000000 Z
11
+ date: 2015-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: terminal-table
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: github-fs
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -275,11 +289,13 @@ files:
275
289
  - ".ruby-version"
276
290
  - ".travis.yml"
277
291
  - CHANGELOG.md
292
+ - Dockerfile
278
293
  - Gemfile
279
294
  - Gemfile.lock
280
295
  - LICENSE.txt
281
296
  - README.md
282
297
  - REFACTOR.md
298
+ - ROADMAP.md
283
299
  - Rakefile
284
300
  - TUTORIAL.md
285
301
  - apps/blueprint/config.rb
@@ -287,6 +303,7 @@ files:
287
303
  - apps/blueprint/documentation/diagram.md
288
304
  - apps/blueprint/documentation/epic.md
289
305
  - apps/blueprint/documentation/feature.md
306
+ - apps/blueprint/documentation/index.md
290
307
  - apps/blueprint/documentation/milestone.md
291
308
  - apps/blueprint/documentation/mockup.md
292
309
  - apps/blueprint/documentation/outline.md
@@ -344,6 +361,7 @@ files:
344
361
  - lib/brief/cli/all.rb
345
362
  - lib/brief/cli/browse.rb
346
363
  - lib/brief/cli/create.rb
364
+ - lib/brief/cli/edit.rb
347
365
  - lib/brief/cli/export.rb
348
366
  - lib/brief/cli/parse.rb
349
367
  - lib/brief/cli/render.rb
@@ -386,6 +404,7 @@ files:
386
404
  - lib/brief/util.rb
387
405
  - lib/brief/version.rb
388
406
  - packaging/wrapper.sh
407
+ - servers/Dockerfile
389
408
  - spec/acceptance/aggregators_spec.rb
390
409
  - spec/acceptance/browsing_spec.rb
391
410
  - spec/acceptance/data_manipulation_spec.rb