yard-mruby 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -9
  3. data/.rspec +2 -2
  4. data/.travis.yml +4 -4
  5. data/CODE_OF_CONDUCT.md +13 -13
  6. data/Gemfile +4 -4
  7. data/LICENSE.txt +21 -21
  8. data/README.md +31 -31
  9. data/Rakefile +6 -6
  10. data/bin/console +14 -14
  11. data/bin/setup +7 -7
  12. data/exe/mrbdoc +5 -5
  13. data/lib/yard-mruby.rb +1 -1
  14. data/lib/yard/mruby.rb +9 -9
  15. data/lib/yard/mruby/cli.rb +1 -1
  16. data/lib/yard/mruby/cli/yardoc.rb +14 -14
  17. data/lib/yard/mruby/code_objects.rb +6 -6
  18. data/lib/yard/mruby/code_objects/define_object.rb +8 -8
  19. data/lib/yard/mruby/code_objects/function_object.rb +72 -72
  20. data/lib/yard/mruby/code_objects/header_base_object.rb +15 -15
  21. data/lib/yard/mruby/code_objects/header_object.rb +30 -30
  22. data/lib/yard/mruby/code_objects/headers_root.rb +14 -14
  23. data/lib/yard/mruby/code_objects/typedef_object.rb +8 -8
  24. data/lib/yard/mruby/handlers.rb +1 -1
  25. data/lib/yard/mruby/handlers/c.rb +4 -4
  26. data/lib/yard/mruby/handlers/c/header.rb +5 -5
  27. data/lib/yard/mruby/handlers/c/header/base.rb +30 -30
  28. data/lib/yard/mruby/handlers/c/header/define_handler.rb +23 -23
  29. data/lib/yard/mruby/handlers/c/header/function_handler.rb +33 -33
  30. data/lib/yard/mruby/handlers/c/header/header_decl_handler.rb +20 -20
  31. data/lib/yard/mruby/handlers/c/header/typedef_handler.rb +31 -31
  32. data/lib/yard/mruby/handlers/c/source.rb +7 -7
  33. data/lib/yard/mruby/handlers/c/source/base.rb +56 -56
  34. data/lib/yard/mruby/handlers/c/source/class_handler.rb +35 -35
  35. data/lib/yard/mruby/handlers/c/source/init_handler.rb +16 -16
  36. data/lib/yard/mruby/handlers/c/source/method_handler.rb +25 -25
  37. data/lib/yard/mruby/handlers/c/source/module_handler.rb +34 -34
  38. data/lib/yard/mruby/handlers/c/source/symbol_handler.rb +16 -16
  39. data/lib/yard/mruby/parser.rb +1 -1
  40. data/lib/yard/mruby/parser/c.rb +4 -4
  41. data/lib/yard/mruby/parser/c/directive_statement.rb +6 -6
  42. data/lib/yard/mruby/parser/c/header_parser.rb +49 -49
  43. data/lib/yard/mruby/parser/c/parser.rb +10 -10
  44. data/lib/yard/mruby/parser/c/source_parser.rb +9 -9
  45. data/lib/yard/mruby/tags.rb +2 -2
  46. data/lib/yard/mruby/templates.rb +9 -9
  47. data/lib/yard/mruby/templates/helpers.rb +1 -1
  48. data/lib/yard/mruby/templates/helpers/html_helper.rb +32 -32
  49. data/lib/yard/mruby/version.rb +5 -5
  50. data/sample/.gitignore +5 -5
  51. data/sample/.inch.yml +3 -3
  52. data/sample/.travis.yml +2 -2
  53. data/sample/.yardopts +4 -4
  54. data/sample/CODE_OF_CONDUCT.md +13 -13
  55. data/sample/Gemfile +5 -5
  56. data/sample/LICENSE.txt +21 -21
  57. data/sample/README.md +12 -12
  58. data/sample/build_config.rb +9 -9
  59. data/sample/include/sample.h +37 -37
  60. data/sample/mrbgem.rake +15 -15
  61. data/sample/mrblib/sample.rb +14 -14
  62. data/sample/src/sample.c +34 -34
  63. data/sample/test/sample_spec.rb +11 -11
  64. data/templates/default/fulldoc/html/full_list_functions.erb +10 -10
  65. data/templates/default/fulldoc/html/full_list_headers.erb +10 -10
  66. data/templates/default/fulldoc/html/setup.rb +62 -62
  67. data/templates/default/function_details/html/function_signature.erb +10 -10
  68. data/templates/default/function_details/html/header.erb +3 -3
  69. data/templates/default/function_details/html/source.erb +10 -10
  70. data/templates/default/function_details/setup.rb +12 -12
  71. data/templates/default/header/html/define_summary.erb +11 -11
  72. data/templates/default/header/html/function_details_list.erb +7 -7
  73. data/templates/default/header/html/function_summary.erb +12 -12
  74. data/templates/default/header/html/functions.erb +1 -1
  75. data/templates/default/header/html/header.erb +1 -1
  76. data/templates/default/header/html/includes.erb +1 -1
  77. data/templates/default/header/html/item_summary.erb +19 -19
  78. data/templates/default/header/html/pre_docstring.erb +1 -1
  79. data/templates/default/header/html/setup.rb +32 -32
  80. data/templates/default/header/html/typedef_summary.erb +11 -11
  81. data/templates/default/headersroot/html/headers_list.erb +6 -6
  82. data/templates/default/headersroot/html/setup.rb +10 -10
  83. data/templates/default/layout/html/footer.erb +5 -5
  84. data/templates/default/layout/html/setup.rb +52 -52
  85. data/templates/default/tags/html/iso.erb +3 -3
  86. data/templates/default/tags/html/mrbgem.erb +3 -3
  87. data/templates/default/tags/setup.rb +10 -10
  88. data/yard-mruby.gemspec +27 -27
  89. metadata +7 -7
@@ -1,10 +1,10 @@
1
- module YARD::MRuby::Parser
2
- module C
3
- class Parser < YARD::Parser::C::CParser
4
- end
5
-
6
- # Disable default C Parser
7
- YARD::Parser::SourceParser.parser_types.delete(:c)
8
- YARD::Parser::SourceParser.parser_type_extensions.delete(:c)
9
- end
10
- end
1
+ module YARD::MRuby::Parser
2
+ module C
3
+ class Parser < YARD::Parser::C::CParser
4
+ end
5
+
6
+ # Disable default C Parser
7
+ YARD::Parser::SourceParser.parser_types.delete(:c)
8
+ YARD::Parser::SourceParser.parser_type_extensions.delete(:c)
9
+ end
10
+ end
@@ -1,9 +1,9 @@
1
- module YARD::MRuby::Parser::C
2
- class SourceParser < Parser
3
- end
4
-
5
- #
6
- # Register all header files (.h) to be processed with the above HeaderParser
7
- YARD::Parser::SourceParser.register_parser_type :source, SourceParser, 'c'
8
-
9
- end
1
+ module YARD::MRuby::Parser::C
2
+ class SourceParser < Parser
3
+ end
4
+
5
+ #
6
+ # Register all header files (.h) to be processed with the above HeaderParser
7
+ YARD::Parser::SourceParser.register_parser_type :source, SourceParser, 'c'
8
+
9
+ end
@@ -1,2 +1,2 @@
1
- YARD::Tags::Library.define_tag("ISO Reference", :ISO, :with_title_and_text)
2
- YARD::Tags::Library.define_tag("Required mrbgem", :mrbgem, :with_title_and_text)
1
+ YARD::Tags::Library.define_tag("ISO Reference", :ISO, :with_title_and_text)
2
+ YARD::Tags::Library.define_tag("Required mrbgem", :mrbgem, :with_title_and_text)
@@ -1,9 +1,9 @@
1
- require_relative 'templates/helpers'
2
-
3
- YARD::MRuby::TEMPLATES_PATH = File.expand_path('../../../../templates', __FILE__)
4
-
5
- # This registered template works for yardoc
6
- YARD::Templates::Engine.register_template_path YARD::MRuby::TEMPLATES_PATH
7
-
8
- # The following static paths and templates are for yard server
9
- # YARD::Server.register_static_path File.join(YARD::MRuby::TEMPLATES_PATH,'default/fulldoc/html')
1
+ require_relative 'templates/helpers'
2
+
3
+ YARD::MRuby::TEMPLATES_PATH = File.expand_path('../../../../templates', __FILE__)
4
+
5
+ # This registered template works for yardoc
6
+ YARD::Templates::Engine.register_template_path YARD::MRuby::TEMPLATES_PATH
7
+
8
+ # The following static paths and templates are for yard server
9
+ # YARD::Server.register_static_path File.join(YARD::MRuby::TEMPLATES_PATH,'default/fulldoc/html')
@@ -1 +1 @@
1
- require_relative 'helpers/html_helper'
1
+ require_relative 'helpers/html_helper'
@@ -1,32 +1,32 @@
1
- module YARD::MRuby::Templates
2
- module Helpers
3
- # Helper methods for text template formats.
4
- module HTMLHelper
5
-
6
- def fsignature(func, link = true, show_extras = true)
7
- name = func.name
8
- prefix = func.return_type || 'void'
9
- params = if func.parameter_types.empty?
10
- 'void'
11
- else
12
- func.parameter_types.map do |t|
13
- if show_extras
14
- [t.type, t.name].join(' ')
15
- else
16
- t.type
17
- end
18
- end.join(', ')
19
- end
20
- title = "%s <strong>%s</strong>(%s)" % [h(prefix), h(name), h(params)]
21
-
22
- if link
23
- url = url_for(func)
24
- link_url(url, title, :title => name)
25
- else
26
- title
27
- end
28
- end
29
-
30
- end
31
- end
32
- end
1
+ module YARD::MRuby::Templates
2
+ module Helpers
3
+ # Helper methods for text template formats.
4
+ module HTMLHelper
5
+
6
+ def fsignature(func, link = true, show_extras = true)
7
+ name = func.name
8
+ prefix = func.return_type || 'void'
9
+ params = if func.parameter_types.empty?
10
+ 'void'
11
+ else
12
+ func.parameter_types.map do |t|
13
+ if show_extras
14
+ [t.type, t.name].join(' ')
15
+ else
16
+ t.type
17
+ end
18
+ end.join(', ')
19
+ end
20
+ title = "%s <strong>%s</strong>(%s)" % [h(prefix), h(name), h(params)]
21
+
22
+ if link
23
+ url = url_for(func)
24
+ link_url(url, title, :title => name)
25
+ else
26
+ title
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
- module YARD
2
- module MRuby
3
- VERSION = "0.2.2"
4
- end
5
- end
1
+ module YARD
2
+ module MRuby
3
+ VERSION = "0.2.3"
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
- build
2
- .bundle
3
- Gemfile.lock
4
- doc
5
- .yardoc
1
+ build
2
+ .bundle
3
+ Gemfile.lock
4
+ doc
5
+ .yardoc
@@ -1,3 +1,3 @@
1
- files:
2
- included:
3
- - mrblib/**/*.rb
1
+ files:
2
+ included:
3
+ - mrblib/**/*.rb
@@ -1,2 +1,2 @@
1
- install: bundle install
2
- script: bundle exec mrb test
1
+ install: bundle install
2
+ script: bundle exec mrb test
@@ -1,4 +1,4 @@
1
- --plugin mruby
2
- mrblib/**/*.rb
3
- src/**/*.c
4
- include/**/*.h
1
+ --plugin mruby
2
+ mrblib/**/*.rb
3
+ src/**/*.c
4
+ include/**/*.h
@@ -1,13 +1,13 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
-
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
-
7
- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
-
9
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
-
11
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
-
13
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
@@ -1,5 +1,5 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'mruby-cli'
4
- gem 'mruby-source', github: 'sagmor/mruby'
5
- gem 'yard-mruby', path: '..'
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'mruby-cli'
4
+ gem 'mruby-source', github: 'sagmor/mruby'
5
+ gem 'yard-mruby', path: '..'
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 [PUT YOUR NAME HERE]
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 [PUT YOUR NAME HERE]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1,12 +1,12 @@
1
- # Sample MRuby GEM
2
-
3
- TODO: Write your README
4
-
5
- ## Contributing
6
-
7
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sample. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
8
-
9
-
10
- ## License
11
-
12
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
1
+ # Sample MRuby GEM
2
+
3
+ TODO: Write your README
4
+
5
+ ## Contributing
6
+
7
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sample. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
8
+
9
+
10
+ ## License
11
+
12
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,9 +1,9 @@
1
- MRuby::Build.new do |conf|
2
- toolchain :gcc
3
- enable_debug
4
-
5
- conf.gem '.'
6
-
7
- conf.enable_test
8
- end
9
-
1
+ MRuby::Build.new do |conf|
2
+ toolchain :gcc
3
+ enable_debug
4
+
5
+ conf.gem '.'
6
+
7
+ conf.enable_test
8
+ end
9
+
@@ -1,37 +1,37 @@
1
- #include "mruby.h"
2
-
3
- #ifndef SAMPLE_H
4
- #define SAMPLE_H
5
-
6
- /**
7
- * Sample C API module definition
8
- */
9
- MRB_BEGIN_DECL
10
-
11
- /**
12
- * A Sample C API method definition
13
- *
14
- * @param mrb The MRuby state.
15
- * @return some ruby value
16
- */
17
- MRB_API mrb_value sample_api_method(mrb_state *mrb);
18
-
19
- /**
20
- * Another API method, now inlined.
21
- *
22
- * @param value some ruby value
23
- * @return the same value
24
- */
25
- MRB_INLINE mrb_value sample_inline_method(mrb_value value)
26
- {
27
- return value;
28
- }
29
-
30
- /**
31
- * A sample deprecated method
32
- */
33
- MRB_API mrb_deprecated void sample_deprecated_method( void );
34
-
35
- MRB_END_DECL
36
-
37
- #endif /* SAMPLE_H */
1
+ #include "mruby.h"
2
+
3
+ #ifndef SAMPLE_H
4
+ #define SAMPLE_H
5
+
6
+ /**
7
+ * Sample C API module definition
8
+ */
9
+ MRB_BEGIN_DECL
10
+
11
+ /**
12
+ * A Sample C API method definition
13
+ *
14
+ * @param mrb The MRuby state.
15
+ * @return some ruby value
16
+ */
17
+ MRB_API mrb_value sample_api_method(mrb_state *mrb);
18
+
19
+ /**
20
+ * Another API method, now inlined.
21
+ *
22
+ * @param value some ruby value
23
+ * @return the same value
24
+ */
25
+ MRB_INLINE mrb_value sample_inline_method(mrb_value value)
26
+ {
27
+ return value;
28
+ }
29
+
30
+ /**
31
+ * A sample deprecated method
32
+ */
33
+ MRB_API mrb_deprecated void sample_deprecated_method( void );
34
+
35
+ MRB_END_DECL
36
+
37
+ #endif /* SAMPLE_H */
@@ -1,15 +1,15 @@
1
- MRuby::Gem::Specification.new('sample') do |spec|
2
- spec.license = 'MIT'
3
- spec.author = 'TODO: Put your name here'
4
- spec.summary = %q{TODO: Write a short summary of your gem.}
5
- spec.version = '0.1.0'
6
-
7
- # Add your runtime dependencies here
8
- # spec.add_dependency('mruby-math', :core => 'mruby-math')
9
-
10
-
11
- # Add your test dependencies here
12
- if build.test_enabled?
13
- spec.add_dependency('mruby-spec', :github => 'sagmor/mruby-spec')
14
- end
15
- end
1
+ MRuby::Gem::Specification.new('sample') do |spec|
2
+ spec.license = 'MIT'
3
+ spec.author = 'TODO: Put your name here'
4
+ spec.summary = %q{TODO: Write a short summary of your gem.}
5
+ spec.version = '0.1.0'
6
+
7
+ # Add your runtime dependencies here
8
+ # spec.add_dependency('mruby-math', :core => 'mruby-math')
9
+
10
+
11
+ # Add your test dependencies here
12
+ if build.test_enabled?
13
+ spec.add_dependency('mruby-spec', :github => 'sagmor/mruby-spec')
14
+ end
15
+ end
@@ -1,14 +1,14 @@
1
- module Sample
2
-
3
- # A Sample test class
4
- class Test
5
-
6
- # Foo returns bar
7
- #
8
- # @return [String] bar!
9
- def foo
10
- return "bar"
11
- end
12
- end
13
-
14
- end
1
+ module Sample
2
+
3
+ # A Sample test class
4
+ class Test
5
+
6
+ # Foo returns bar
7
+ #
8
+ # @return [String] bar!
9
+ def foo
10
+ return "bar"
11
+ end
12
+ end
13
+
14
+ end