brief 0.0.1 → 0.0.2

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.
Files changed (71) hide show
  1. checksums.yaml +5 -13
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +81 -0
  4. data/Guardfile +5 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +71 -0
  7. data/Rakefile +11 -0
  8. data/bin/brief +35 -0
  9. data/brief-0.0.1.gem +0 -0
  10. data/brief.gemspec +33 -0
  11. data/examples/project_overview.md +23 -0
  12. data/lib/brief/cli/commands/config.rb +40 -0
  13. data/lib/brief/cli/commands/publish.rb +27 -0
  14. data/lib/brief/cli/commands/write.rb +26 -0
  15. data/lib/brief/configuration.rb +134 -0
  16. data/lib/brief/document.rb +68 -0
  17. data/lib/brief/dsl.rb +0 -0
  18. data/lib/brief/formatters/base.rb +12 -0
  19. data/lib/brief/formatters/github_milestone_rollup.rb +52 -0
  20. data/lib/brief/git.rb +19 -0
  21. data/lib/brief/github/wiki.rb +9 -0
  22. data/lib/brief/github.rb +78 -0
  23. data/lib/brief/github_client/authentication.rb +32 -0
  24. data/lib/brief/github_client/client.rb +86 -0
  25. data/lib/brief/github_client/commands.rb +5 -0
  26. data/lib/brief/github_client/issue_labels.rb +65 -0
  27. data/lib/brief/github_client/issues.rb +22 -0
  28. data/lib/brief/github_client/milestone_issues.rb +13 -0
  29. data/lib/brief/github_client/organization_activity.rb +9 -0
  30. data/lib/brief/github_client/organization_issues.rb +13 -0
  31. data/lib/brief/github_client/organization_repositories.rb +20 -0
  32. data/lib/brief/github_client/organization_users.rb +9 -0
  33. data/lib/brief/github_client/repository_events.rb +8 -0
  34. data/lib/brief/github_client/repository_issue_events.rb +9 -0
  35. data/lib/brief/github_client/repository_issues.rb +8 -0
  36. data/lib/brief/github_client/repository_labels.rb +18 -0
  37. data/lib/brief/github_client/repository_milestones.rb +9 -0
  38. data/lib/brief/github_client/request.rb +181 -0
  39. data/lib/brief/github_client/request_wrapper.rb +121 -0
  40. data/lib/brief/github_client/response_object.rb +50 -0
  41. data/lib/brief/github_client/single_repository.rb +9 -0
  42. data/lib/brief/github_client/user_activity.rb +16 -0
  43. data/lib/brief/github_client/user_gists.rb +9 -0
  44. data/lib/brief/github_client/user_info.rb +9 -0
  45. data/lib/brief/github_client/user_issues.rb +13 -0
  46. data/lib/brief/github_client/user_organizations.rb +9 -0
  47. data/lib/brief/github_client/user_repositories.rb +9 -0
  48. data/lib/brief/github_client.rb +43 -0
  49. data/lib/brief/handlers/base.rb +62 -0
  50. data/lib/brief/handlers/github_issue.rb +41 -0
  51. data/lib/brief/handlers/github_milestone.rb +37 -0
  52. data/lib/brief/handlers/github_wiki.rb +11 -0
  53. data/lib/brief/line.rb +69 -0
  54. data/lib/brief/parser.rb +354 -0
  55. data/lib/brief/publisher/handler_manager.rb +47 -0
  56. data/lib/brief/publisher.rb +142 -0
  57. data/lib/brief/tree.rb +42 -0
  58. data/lib/brief/version.rb +9 -0
  59. data/lib/brief.rb +56 -0
  60. data/lib/core_ext.rb +37 -0
  61. data/spec/fixtures/front_end_tutorial.md +33 -0
  62. data/spec/fixtures/generated/project_overview.json +0 -0
  63. data/spec/fixtures/generator_dsl_example.rb +22 -0
  64. data/spec/fixtures/project_overview.md +48 -0
  65. data/spec/fixtures/sample.md +19 -0
  66. data/spec/lib/brief/document_spec.rb +35 -0
  67. data/spec/lib/brief/dsl_spec.rb +21 -0
  68. data/spec/lib/brief/line_spec.rb +11 -0
  69. data/spec/lib/brief/parser_spec.rb +12 -0
  70. data/spec/spec_helper.rb +25 -0
  71. metadata +231 -9
@@ -0,0 +1,33 @@
1
+ # Backbone View Tutorial
2
+
3
+ Below is an example of how you can style a backbone view.
4
+
5
+ ## Template Content
6
+
7
+ First write a basic template.
8
+
9
+ ```slim
10
+ nav.nav.navbar-inverse
11
+ .container
12
+ .row-fluid
13
+ ```
14
+
15
+ ## Style Content
16
+
17
+ Make the text pink, because it is manly.
18
+
19
+ ```scss
20
+ nav.navbar-inverse {
21
+ color: pink;
22
+ }
23
+ ```
24
+
25
+ ## Script Content
26
+
27
+ Then you'll wanna do some stuff with the coffeescript.
28
+
29
+ ```coffeescript
30
+ MyView = Backbone.View.extend
31
+ className: "navbar-inverse"
32
+ ```
33
+
File without changes
@@ -0,0 +1,22 @@
1
+ Brief.define "Project Overview" do
2
+ aliases :project_overview
3
+
4
+ levels do
5
+ level(1) do
6
+ name "Wiki Page"
7
+ define_handler :create => "Brief::Handlers::GithubWiki"
8
+ replaces_items_from_level 2, :with => "Brief::Formatters::GithubMilestoneRollup"
9
+ end
10
+
11
+ level(2) do
12
+ name "Github Milestone"
13
+ define_handler :create => "Brief::Handlers::GithubMilestone"
14
+ replaces_items_from_level 3, :with => nil
15
+ end
16
+
17
+ level(3) do
18
+ name "Github Issue"
19
+ define_handler :create => "Brief::Handlers::GithubIssue"
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,48 @@
1
+ # Wiki Page Heading
2
+
3
+ Content. Will go on a wiki page. The content below here, and the subheadings, will be replaced with a roll-up / summary of the elements.
4
+
5
+ ## Milestone Heading
6
+
7
+ This content will go in the milestone body. The wiki page that this belongs to, will include a different kind of view of this content.
8
+
9
+ ### An issue title
10
+
11
+ This goes in the issue's body. The wiki page this belongs to will possibly have a link to the issue and a label for its status.
12
+
13
+ ### Another issue title
14
+
15
+ This goes in this issue's body. Same thing. It obviously belongs to the milestone.
16
+
17
+ ## Milestone Heading Two
18
+
19
+ Additional content for the milestone heading.
20
+
21
+ ### Another nested issue
22
+
23
+ This one has some content, as well as a code block.
24
+
25
+ ```ruby
26
+ class MyClass
27
+ def sup
28
+ puts "Sup?"
29
+ end
30
+ end
31
+ ```
32
+
33
+ Some more content for safety's sake.
34
+
35
+ ### Another nested issue my man
36
+
37
+ Some plain old content with a list:
38
+
39
+ - item one
40
+ - item two
41
+ - item three
42
+ - item four
43
+
44
+ #### What about this deep heading? It should be meaningless.
45
+
46
+ ## A Third milestone
47
+
48
+ No content exists.
@@ -0,0 +1,19 @@
1
+ # Heading One
2
+
3
+ Content under heading one.
4
+
5
+ ## Subheading One
6
+
7
+ Subheading One is my parent. Heading One is my grandparent.
8
+
9
+ ## Subheading Two
10
+
11
+ Subheading Two is my parent. Heading one is my grandparent.
12
+
13
+ # Heading Two
14
+
15
+ Heading two content.
16
+
17
+ ## Subheading Three
18
+
19
+ Subheading Three is my parent. Heading Two is my grandparent.
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe Brief::Document do
4
+ let(:path) { Brief.fixtures.join("sample.md") }
5
+
6
+ let(:tutorial) do
7
+ Brief::Document.new(path: path)
8
+ end
9
+
10
+ it "should let me pass raw markdown" do
11
+ level_one = Brief::Document.new(path.read).tree.level(1)
12
+ expect(level_one.first.title).to eq("Heading One")
13
+ end
14
+
15
+ it "should let me pass a markdown file" do
16
+ level_one = Brief::Document.new(path).tree.level(1)
17
+ expect(level_one.first.title).to eq("Heading One")
18
+ end
19
+
20
+ describe "Parsers and Publishers" do
21
+ it "should have a parser" do
22
+ expect(tutorial.parser).not_to be_nil
23
+ end
24
+
25
+ it "should have a publisher" do
26
+ expect(tutorial.publisher).not_to be_nil
27
+ end
28
+ end
29
+
30
+ describe "Finding code blocks by language" do
31
+ it "should find the blocks of code and group them by their language" do
32
+ expect(tutorial.code_blocks_by_language).not_to be_empty
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,21 @@
1
+ require "spec_helper"
2
+
3
+ describe "The Publisher definition DSL" do
4
+ before(:all) do
5
+ require Brief.fixtures.join("generator_dsl_example.rb")
6
+ end
7
+
8
+ it "should define a generator called Project Overview" do
9
+ expect(Brief::Publisher.fetch("Project Overview")).to be_present
10
+ end
11
+
12
+ it "should find the appropriate Publisher by using an alias" do
13
+ expect(Brief::Publisher.fetch("project_overview")).to be_present
14
+ end
15
+
16
+ it "should find the appropriate Publisher using a case insensitve search" do
17
+ expect(Brief::Publisher.fetch("project overview")).to be_present
18
+ end
19
+
20
+
21
+ end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ describe Brief::Line do
4
+ let(:heading1) { Brief::Line.new("# sup?", 1, false) }
5
+ let(:heading2) { Brief::Line.new("##sup?", 2, false) }
6
+
7
+ it "should set the level" do
8
+ expect(heading1.level).to eq(1)
9
+ expect(heading2.level).to eq(2)
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ describe Brief::Parser do
4
+ let(:sample) do
5
+ Brief::Document.new(Brief.fixtures.join("sample.md")).parser
6
+ end
7
+
8
+ it "should give me information about the headings" do
9
+ expect(sample.headings_at_level(1)).to eq(["Heading One", "Heading Two"])
10
+ expect(sample.headings_at_level(2)).to eq(["Subheading One", "Subheading Two", "Subheading Three"])
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ spec = File.dirname(__FILE__)
2
+ $LOAD_PATH.unshift(spec) unless $LOAD_PATH.include?(spec)
3
+
4
+ lib = File.join(File.dirname(__FILE__), '../lib')
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+
7
+ require 'pry'
8
+ require 'brief'
9
+
10
+ module Brief
11
+ def self.project_overview_example
12
+ @project_overview_example ||= Brief::Document.new fixtures.join("project_overview.md")
13
+ end
14
+
15
+ def self.test_documents
16
+ @test_documents ||= fixtures.children.select {|f| f.file? }.map {|c| Brief::Document.new(c) }
17
+ end
18
+
19
+ def self.fixtures
20
+ spec = File.dirname(__FILE__)
21
+ Pathname(spec).join("fixtures")
22
+ end
23
+ end
24
+
25
+ Brief.test_documents
metadata CHANGED
@@ -1,15 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brief
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Soeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: commander
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: colored
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'
55
+ - !ruby/object:Gem::Dependency
56
+ name: active_support
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: i18n
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
13
83
  - !ruby/object:Gem::Dependency
14
84
  name: bundler
15
85
  requirement: !ruby/object:Gem::Requirement
@@ -28,23 +98,165 @@ dependencies:
28
98
  name: rake
29
99
  requirement: !ruby/object:Gem::Requirement
30
100
  requirements:
31
- - - ! '>='
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-nav
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: guard
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: guard-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
32
172
  - !ruby/object:Gem::Version
33
173
  version: '0'
34
174
  type: :development
35
175
  prerelease: false
36
176
  version_requirements: !ruby/object:Gem::Requirement
37
177
  requirements:
38
- - - ! '>='
178
+ - - '>='
39
179
  - !ruby/object:Gem::Version
40
180
  version: '0'
41
181
  description: Brief is a utility to make writing more productive for software architects.
182
+ It allows you write to places like Github Wiki, The Github Issues API all from the
183
+ command line and a single file.
42
184
  email:
43
185
  - jonathan.soeder@gmail.com
44
- executables: []
186
+ executables:
187
+ - brief
45
188
  extensions: []
46
189
  extra_rdoc_files: []
47
- files: []
190
+ files:
191
+ - Gemfile
192
+ - Gemfile.lock
193
+ - Guardfile
194
+ - LICENSE.txt
195
+ - README.md
196
+ - Rakefile
197
+ - bin/brief
198
+ - brief-0.0.1.gem
199
+ - brief.gemspec
200
+ - examples/project_overview.md
201
+ - lib/brief.rb
202
+ - lib/brief/cli/commands/config.rb
203
+ - lib/brief/cli/commands/publish.rb
204
+ - lib/brief/cli/commands/write.rb
205
+ - lib/brief/configuration.rb
206
+ - lib/brief/document.rb
207
+ - lib/brief/dsl.rb
208
+ - lib/brief/formatters/base.rb
209
+ - lib/brief/formatters/github_milestone_rollup.rb
210
+ - lib/brief/git.rb
211
+ - lib/brief/github.rb
212
+ - lib/brief/github/wiki.rb
213
+ - lib/brief/github_client.rb
214
+ - lib/brief/github_client/authentication.rb
215
+ - lib/brief/github_client/client.rb
216
+ - lib/brief/github_client/commands.rb
217
+ - lib/brief/github_client/issue_labels.rb
218
+ - lib/brief/github_client/issues.rb
219
+ - lib/brief/github_client/milestone_issues.rb
220
+ - lib/brief/github_client/organization_activity.rb
221
+ - lib/brief/github_client/organization_issues.rb
222
+ - lib/brief/github_client/organization_repositories.rb
223
+ - lib/brief/github_client/organization_users.rb
224
+ - lib/brief/github_client/repository_events.rb
225
+ - lib/brief/github_client/repository_issue_events.rb
226
+ - lib/brief/github_client/repository_issues.rb
227
+ - lib/brief/github_client/repository_labels.rb
228
+ - lib/brief/github_client/repository_milestones.rb
229
+ - lib/brief/github_client/request.rb
230
+ - lib/brief/github_client/request_wrapper.rb
231
+ - lib/brief/github_client/response_object.rb
232
+ - lib/brief/github_client/single_repository.rb
233
+ - lib/brief/github_client/user_activity.rb
234
+ - lib/brief/github_client/user_gists.rb
235
+ - lib/brief/github_client/user_info.rb
236
+ - lib/brief/github_client/user_issues.rb
237
+ - lib/brief/github_client/user_organizations.rb
238
+ - lib/brief/github_client/user_repositories.rb
239
+ - lib/brief/handlers/base.rb
240
+ - lib/brief/handlers/github_issue.rb
241
+ - lib/brief/handlers/github_milestone.rb
242
+ - lib/brief/handlers/github_wiki.rb
243
+ - lib/brief/line.rb
244
+ - lib/brief/parser.rb
245
+ - lib/brief/publisher.rb
246
+ - lib/brief/publisher/handler_manager.rb
247
+ - lib/brief/tree.rb
248
+ - lib/brief/version.rb
249
+ - lib/core_ext.rb
250
+ - spec/fixtures/front_end_tutorial.md
251
+ - spec/fixtures/generated/project_overview.json
252
+ - spec/fixtures/generator_dsl_example.rb
253
+ - spec/fixtures/project_overview.md
254
+ - spec/fixtures/sample.md
255
+ - spec/lib/brief/document_spec.rb
256
+ - spec/lib/brief/dsl_spec.rb
257
+ - spec/lib/brief/line_spec.rb
258
+ - spec/lib/brief/parser_spec.rb
259
+ - spec/spec_helper.rb
48
260
  homepage: http://architects.io/brief
49
261
  licenses:
50
262
  - MIT
@@ -55,12 +267,12 @@ require_paths:
55
267
  - lib
56
268
  required_ruby_version: !ruby/object:Gem::Requirement
57
269
  requirements:
58
- - - ! '>='
270
+ - - '>='
59
271
  - !ruby/object:Gem::Version
60
272
  version: '0'
61
273
  required_rubygems_version: !ruby/object:Gem::Requirement
62
274
  requirements:
63
- - - ! '>='
275
+ - - '>='
64
276
  - !ruby/object:Gem::Version
65
277
  version: '0'
66
278
  requirements: []
@@ -69,4 +281,14 @@ rubygems_version: 2.1.11
69
281
  signing_key:
70
282
  specification_version: 4
71
283
  summary: Brief is a utility to make writing more productive for software architects.
72
- test_files: []
284
+ test_files:
285
+ - spec/fixtures/front_end_tutorial.md
286
+ - spec/fixtures/generated/project_overview.json
287
+ - spec/fixtures/generator_dsl_example.rb
288
+ - spec/fixtures/project_overview.md
289
+ - spec/fixtures/sample.md
290
+ - spec/lib/brief/document_spec.rb
291
+ - spec/lib/brief/dsl_spec.rb
292
+ - spec/lib/brief/line_spec.rb
293
+ - spec/lib/brief/parser_spec.rb
294
+ - spec/spec_helper.rb