kanpachi 0.0.3 → 0.0.4

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/CHANGELOG.md +6 -0
  4. data/kanpachi.gemspec +5 -5
  5. data/lib/kanpachi/cli.rb +9 -5
  6. data/lib/kanpachi/doc/middleman-ext/middleman-deploy.rb +22 -0
  7. data/lib/kanpachi/{documentation → doc/template}/config.rb +3 -3
  8. data/lib/kanpachi/{documentation → doc/template}/source/errors/index.html.slim +0 -0
  9. data/lib/kanpachi/{documentation → doc/template}/source/fonts/glyphicons-halflings-regular.eot +0 -0
  10. data/lib/kanpachi/{documentation → doc/template}/source/fonts/glyphicons-halflings-regular.svg +0 -0
  11. data/lib/kanpachi/{documentation → doc/template}/source/fonts/glyphicons-halflings-regular.ttf +0 -0
  12. data/lib/kanpachi/{documentation → doc/template}/source/fonts/glyphicons-halflings-regular.woff +0 -0
  13. data/lib/kanpachi/{documentation → doc/template}/source/images/background.png +0 -0
  14. data/lib/kanpachi/{documentation → doc/template}/source/images/middleman.png +0 -0
  15. data/lib/kanpachi/{documentation → doc/template}/source/index.html.slim +0 -0
  16. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/all.js +0 -0
  17. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/bootstrap.js +0 -0
  18. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/bootstrap.min.js +0 -0
  19. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/html5shiv.js +0 -0
  20. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/jquery-1.10.2.min.js +0 -0
  21. data/lib/kanpachi/{documentation → doc/template}/source/javascripts/respond.min.js +0 -0
  22. data/lib/kanpachi/{documentation → doc/template}/source/layouts/layout.slim +0 -0
  23. data/lib/kanpachi/{documentation → doc/template}/source/resource.html.slim +0 -0
  24. data/lib/kanpachi/{documentation → doc/template}/source/stylesheets/bootstrap-theme.css +0 -0
  25. data/lib/kanpachi/{documentation → doc/template}/source/stylesheets/bootstrap-theme.min.css +0 -0
  26. data/lib/kanpachi/{documentation → doc/template}/source/stylesheets/bootstrap.css +0 -0
  27. data/lib/kanpachi/{documentation → doc/template}/source/stylesheets/bootstrap.min.css +0 -0
  28. data/lib/kanpachi/{documentation → doc/template}/source/stylesheets/jumbotron.css +0 -0
  29. data/lib/kanpachi/response.rb +4 -0
  30. data/lib/kanpachi/version.rb +1 -1
  31. metadata +34 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e5b6e4840bc2626d0f535c41b4b1616c68ed104
4
- data.tar.gz: 6a8a37c95c72696c02a1d16584f86a2e7a52da83
3
+ metadata.gz: 8b55c01d01b90779258c2e170be5a0125a1cbb55
4
+ data.tar.gz: 02a41a98655be74d77874f77a0f43fb970dc9d54
5
5
  SHA512:
6
- metadata.gz: a3b3203cf7f46001360c790ebe6737221121a43e9be71d4ea9df159c2090c60c7e22bb776f25eb497128a6dc72836a16c1684d54ab4711b044f311441114367c
7
- data.tar.gz: a23863a0ce77e9774db497c11c683dc350d91adc7db3011d0c490f15313c941ce545bc46befd62a6987110467f22b0249c08f9b6a6e10763d745c001add80099
6
+ metadata.gz: 5483acf81a19d4f96fa179aee97539250a0054638442e2ddfe9397f642c6d77948e781ddb752521aeefe27dd05fcb825cbbc7f4dfc5b3d963a91fe0fa3d6f558
7
+ data.tar.gz: 246d9f2479ca917f92ae46d1dae90a0603b3a0f0e450d819c6781652255d3f0a2550b4c42152020fa995319272f4e9da772a015cc526cd6990a16521643525fd
data/.gitignore CHANGED
@@ -8,7 +8,7 @@ Gemfile.lock
8
8
  InstalledFiles
9
9
  _yardoc
10
10
  coverage
11
- doc/
11
+ /doc
12
12
  lib/bundler/man
13
13
  pkg
14
14
  rdoc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Kanpachi Changelog
2
2
 
3
+ ## 0.0.4
4
+ * Add support for middleman-deploy extension, just add middleman-deploy to your
5
+ Gemfile and then activate it in your doc/config.rb
6
+ * Move documentation directory to doc and move doc template into doc/template
7
+ * Default render_nils to true in all roar representers
8
+
3
9
  ## 0.0.3
4
10
  * Wrap documentation footer in a container class to pad copyright
5
11
  * Switch response roar representer to decorator. Prefer decorating objects
data/kanpachi.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Kanpachi::VERSION
9
9
  spec.authors = ["Jack Chu"]
10
10
  spec.email = ["kamuigt@gmail.com"]
11
- spec.description = %q{Web API DSL}
12
- spec.summary = %q{DSL for describing Web APIs}
11
+ spec.summary = %q{DSL for describing Web APIs and generating documentation}
12
+ spec.description = %q{Kanpachi is a ruby gem that provides a DSL to describe your web API, generate documentation, and will even eventually help you implement it.}
13
13
  spec.homepage = "https://github.com/kamui/kanpachi"
14
14
  spec.license = "MIT"
15
15
 
@@ -22,12 +22,12 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'roar'
23
23
  spec.add_dependency 'representable'
24
24
  spec.add_dependency 'mutations'
25
- spec.add_dependency 'virtus', '~> 1.0.0rc2'
25
+ spec.add_dependency 'virtus', '~> 1.0.0'
26
26
  spec.add_dependency 'coercible'
27
27
  spec.add_dependency 'kramdown'
28
28
  spec.add_dependency 'inflecto'
29
- spec.add_dependency 'middleman', '~> 3.1.5'
30
- spec.add_dependency 'slim', '~> 1.3.9'
29
+ spec.add_dependency 'middleman', '~> 3.1.6'
30
+ spec.add_dependency 'slim', '~> 2.0.1'
31
31
 
32
32
  # Live-reloading plugin
33
33
  spec.add_dependency 'middleman-livereload', '~> 3.1.0'
data/lib/kanpachi/cli.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  require 'thor'
2
- require 'inflecto'
3
- require 'json'
4
2
  require 'middleman-core'
5
3
  require 'middleman-core/cli'
6
4
  require 'middleman-core/profiling'
7
- require_relative '../kanpachi'
8
- require_relative 'commands/new'
5
+ require 'kanpachi'
6
+ require 'kanpachi/commands/new'
7
+
8
+ # doc template requires these gems
9
+ require 'inflecto'
10
+ require 'json'
9
11
 
10
- ENV['MM_ROOT'] = File.join(File.expand_path(File.dirname(__FILE__)), 'documentation')
12
+ ENV['MM_ROOT'] = File.join(File.expand_path(File.dirname(__FILE__)), 'doc', 'template')
11
13
 
12
14
  class Middleman::Cli::Server
13
15
  default_task :server
@@ -30,3 +32,5 @@ module Kanpachi
30
32
  register ::Middleman::Cli::Build, 'build', task.usage, task.description, task.options
31
33
  end
32
34
  end
35
+
36
+ require 'kanpachi/doc/middleman-ext/middleman-deploy'
@@ -0,0 +1,22 @@
1
+ require 'thor'
2
+ require 'middleman-core'
3
+ require 'middleman-core/cli'
4
+ require 'kanpachi'
5
+
6
+ begin
7
+ require 'middleman-deploy'
8
+ rescue LoadError
9
+ end
10
+
11
+ if defined? Middleman::Cli::Deploy
12
+ class Middleman::Cli::Deploy
13
+ default_task :deploy
14
+ end
15
+
16
+ module Kanpachi
17
+ class CLI < Thor
18
+ task = ::Middleman::Cli::Deploy.tasks['deploy']
19
+ register ::Middleman::Cli::Deploy, 'deploy', task.usage, task.description, task.options
20
+ end
21
+ end
22
+ end
@@ -65,12 +65,12 @@ set :js_dir, 'javascripts'
65
65
 
66
66
  set :images_dir, 'images'
67
67
 
68
- project_config_file = File.join(Dir.pwd, 'documentation', 'config.rb')
68
+ project_config_file = File.join(Dir.pwd, 'doc', 'config.rb')
69
69
  if File.exist?(project_config_file)
70
70
  self.instance_eval File.read(project_config_file)
71
- puts 'Loaded documentation/config.rb'
71
+ puts 'Loaded doc/config.rb'
72
72
  else
73
- puts 'No documentation/config.rb file found'
73
+ puts 'No doc/config.rb file found'
74
74
 
75
75
  # Reload the browser automatically whenever files change
76
76
  activate :livereload
@@ -23,6 +23,10 @@ module Kanpachi
23
23
  include Roar::Representer::JSON
24
24
  include Roar::Decorator::HypermediaConsumer
25
25
 
26
+ def self.property(name, options={})
27
+ super(name, options.merge!(render_nil: true))
28
+ end
29
+
26
30
  def self.example
27
31
  example = Hash.new
28
32
  self.properties.each do |key, value|
@@ -1,3 +1,3 @@
1
1
  module Kanpachi
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanpachi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Chu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-12 00:00:00.000000000 Z
11
+ date: 2013-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.0rc2
75
+ version: 1.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.0rc2
82
+ version: 1.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coercible
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 3.1.5
131
+ version: 3.1.6
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 3.1.5
138
+ version: 3.1.6
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: slim
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.3.9
145
+ version: 2.0.1
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.3.9
152
+ version: 2.0.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: middleman-livereload
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -234,7 +234,8 @@ dependencies:
234
234
  - - ">="
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
- description: Web API DSL
237
+ description: Kanpachi is a ruby gem that provides a DSL to describe your web API,
238
+ generate documentation, and will even eventually help you implement it.
238
239
  email:
239
240
  - kamuigt@gmail.com
240
241
  executables:
@@ -259,28 +260,29 @@ files:
259
260
  - lib/kanpachi/api_list.rb
260
261
  - lib/kanpachi/cli.rb
261
262
  - lib/kanpachi/commands/new.rb
262
- - lib/kanpachi/documentation/config.rb
263
- - lib/kanpachi/documentation/source/errors/index.html.slim
264
- - lib/kanpachi/documentation/source/fonts/glyphicons-halflings-regular.eot
265
- - lib/kanpachi/documentation/source/fonts/glyphicons-halflings-regular.svg
266
- - lib/kanpachi/documentation/source/fonts/glyphicons-halflings-regular.ttf
267
- - lib/kanpachi/documentation/source/fonts/glyphicons-halflings-regular.woff
268
- - lib/kanpachi/documentation/source/images/background.png
269
- - lib/kanpachi/documentation/source/images/middleman.png
270
- - lib/kanpachi/documentation/source/index.html.slim
271
- - lib/kanpachi/documentation/source/javascripts/all.js
272
- - lib/kanpachi/documentation/source/javascripts/bootstrap.js
273
- - lib/kanpachi/documentation/source/javascripts/bootstrap.min.js
274
- - lib/kanpachi/documentation/source/javascripts/html5shiv.js
275
- - lib/kanpachi/documentation/source/javascripts/jquery-1.10.2.min.js
276
- - lib/kanpachi/documentation/source/javascripts/respond.min.js
277
- - lib/kanpachi/documentation/source/layouts/layout.slim
278
- - lib/kanpachi/documentation/source/resource.html.slim
279
- - lib/kanpachi/documentation/source/stylesheets/bootstrap-theme.css
280
- - lib/kanpachi/documentation/source/stylesheets/bootstrap-theme.min.css
281
- - lib/kanpachi/documentation/source/stylesheets/bootstrap.css
282
- - lib/kanpachi/documentation/source/stylesheets/bootstrap.min.css
283
- - lib/kanpachi/documentation/source/stylesheets/jumbotron.css
263
+ - lib/kanpachi/doc/middleman-ext/middleman-deploy.rb
264
+ - lib/kanpachi/doc/template/config.rb
265
+ - lib/kanpachi/doc/template/source/errors/index.html.slim
266
+ - lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.eot
267
+ - lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.svg
268
+ - lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.ttf
269
+ - lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.woff
270
+ - lib/kanpachi/doc/template/source/images/background.png
271
+ - lib/kanpachi/doc/template/source/images/middleman.png
272
+ - lib/kanpachi/doc/template/source/index.html.slim
273
+ - lib/kanpachi/doc/template/source/javascripts/all.js
274
+ - lib/kanpachi/doc/template/source/javascripts/bootstrap.js
275
+ - lib/kanpachi/doc/template/source/javascripts/bootstrap.min.js
276
+ - lib/kanpachi/doc/template/source/javascripts/html5shiv.js
277
+ - lib/kanpachi/doc/template/source/javascripts/jquery-1.10.2.min.js
278
+ - lib/kanpachi/doc/template/source/javascripts/respond.min.js
279
+ - lib/kanpachi/doc/template/source/layouts/layout.slim
280
+ - lib/kanpachi/doc/template/source/resource.html.slim
281
+ - lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css
282
+ - lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.min.css
283
+ - lib/kanpachi/doc/template/source/stylesheets/bootstrap.css
284
+ - lib/kanpachi/doc/template/source/stylesheets/bootstrap.min.css
285
+ - lib/kanpachi/doc/template/source/stylesheets/jumbotron.css
284
286
  - lib/kanpachi/dsl.rb
285
287
  - lib/kanpachi/dsl/api.rb
286
288
  - lib/kanpachi/dsl/error.rb
@@ -347,7 +349,7 @@ rubyforge_project:
347
349
  rubygems_version: 2.1.7
348
350
  signing_key:
349
351
  specification_version: 4
350
- summary: DSL for describing Web APIs
352
+ summary: DSL for describing Web APIs and generating documentation
351
353
  test_files:
352
354
  - spec/api_list_spec.rb
353
355
  - spec/api_spec.rb