yard-bird 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,15 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 0.1.2 | 2011-11-10
4
+
5
+ This release simply brings the build configuration
6
+ up to date. Nothing has change functionally.
7
+
8
+ Changes:
9
+
10
+ * Modernize build configuration.
11
+
12
+
3
13
  == 0.1.1 | 2011-06-10
4
14
 
5
15
  This is the initial release of Yardbird.
@@ -0,0 +1,12 @@
1
+ = Developer's Notes
2
+
3
+ == TODO
4
+
5
+ === file://test/system/test_yardoc.rb
6
+
7
+ * TODO: more verifications (26)
8
+
9
+ === file://test/unit/test_rules.rb
10
+
11
+ * TODO: Write some unit tests!!! (25)
12
+
@@ -2,7 +2,7 @@
2
2
 
3
3
  == YardBird
4
4
 
5
- Copyright (c) 2011 Thomas Sawyer
5
+ Copyright (c) 2011 Rubyworks
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining
8
8
  a copy of this software and associated documentation files (the
@@ -50,7 +50,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
50
50
  OTHER DEALINGS IN THE SOFTWARE.
51
51
 
52
52
 
53
- == Tomdoc
53
+ == TomDoc
54
54
 
55
55
  Copyright (c) 2010 Tom Preston-Werner, Chris Wanstrath
56
56
 
@@ -11,16 +11,17 @@ documentation parsing system.
11
11
 
12
12
  == Resources
13
13
 
14
- * home: http://rubyworks.github.com/
15
- * code: http://github.com/rubyworks/
16
- * mail: http://groups.google.com/group/rubyworks-mailinglist
14
+ * {Homepage}[http://rubyworks.github.com]
15
+ * {Source Code}[http://github.com/rubyworks]
16
+ * {Mainling List}[http://groups.google.com/group/rubyworks-mailinglist]
17
+ * {<img src="http://travis-ci.org/rubyworks/yard-bird.png" />}[http://travis-ci.org/rubyworks/yard-bird]
17
18
 
18
19
 
19
20
  == Check It Out
20
21
 
21
22
  Sound like a chore? Until you see it allows you do this:
22
23
 
23
- # .yard/name.song
24
+ # .yard/example.bird
24
25
 
25
26
  When /^Returns\s+(.*?)$/ do |matchdata, comment|
26
27
  create_tag(:return, matchdata[1])
@@ -29,11 +30,10 @@ Sound like a chore? Until you see it allows you do this:
29
30
  Now, whenever your documentation starts with 'Returns ', the
30
31
  remainder of the line will be added to YARD as a :return tag.
31
32
 
32
- Now we can get even crazier with a basic implementation of Tomdoc[http://tomdoc].
33
+ Now we can get even crazier a create a simplified implementation of {Tomdoc}[http://tomdoc].
33
34
 
34
35
  require 'tomdoc/tomdoc'
35
36
 
36
- # God is /\A.*?\Z/
37
37
  When /\A.*?\Z/m do |matchdata, comment|
38
38
  tomdoc = TomDoc::TomDoc.new(comment)
39
39
  tomdoc.examples.each {|ex| create_tag(:example, "\n" + ex) }
@@ -43,11 +43,14 @@ Now we can get even crazier with a basic implementation of Tomdoc[http://tomdoc]
43
43
  tomdoc.description
44
44
  end
45
45
 
46
+ Now it's your turn. You have the _power_*, Yard Bird will singe _Your_ song.
47
+ And YARD will happily spit it out all pretty.
48
+
46
49
 
47
50
  == License
48
51
 
49
52
  (MIT License)
50
53
 
51
- Copyright (c) 2011 Thomas Sawyer
54
+ Copyright (c) 2011 Rubyworks
52
55
 
53
56
  See NOTICE.rdoc file for more details.
@@ -28,7 +28,7 @@ module YARD
28
28
  # In the example the special rules will have precedence over the
29
29
  # tomdoc rules.
30
30
  #
31
- # Returns nothing.
31
+ # @return Nothing
32
32
  def load_rules
33
33
  files = Dir[".yard/*.bird"].sort
34
34
  files.each do |file|
@@ -41,12 +41,14 @@ module YARD
41
41
  # pattern - Regexp to match against comment.
42
42
  # block - Proc for handling pattern match.
43
43
  #
44
- # Returns [Proc] the given block.
44
+ # @return [Proc] the given block
45
45
  def When(pattern, &block)
46
46
  patterns[pattern] = block
47
47
  end
48
48
 
49
- # Returns [Hash] patterns mapped to corresponding procedures.
49
+ # Patterns to apply.
50
+ #
51
+ # @Return [Hash] patterns mapped to corresponding procedures
50
52
  def patterns
51
53
  @patterns
52
54
  end
@@ -1,6 +1,17 @@
1
1
  module YARD
2
2
  module Bird
3
- VERSION = "0.1.1"
3
+ #
4
+ def self.dotruby
5
+ @dotruby ||= (
6
+ require 'yaml'
7
+ file = File.dirname(__FILE__)+'/../../.ruby'
8
+ File.exist?(file) ? YAML.load_file(file) : {}
9
+ )
10
+ end
11
+ #
12
+ def self.const_missing(name)
13
+ dotruby[name.to_s.downcase] || super(name)
14
+ end
4
15
  end
5
16
  end
6
17
 
@@ -0,0 +1,6 @@
1
+ $:.unshift File.expand_path(File.dirname(__FILE__)) + "/../lib"
2
+
3
+ require 'fileutils'
4
+ require 'minitest/spec'
5
+ require 'minitest/autorun'
6
+
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'yaml'
4
+
5
+ # A really stupid simple example, using YAML mapping.
6
+ # (It's stupid b/c only one tag can be used.)
7
+
8
+ # God is /\A.*?\Z/
9
+ When /\A.*?\Z/m do |matchdata, comment|
10
+ md = /\-\-\-.*?\.\.\./m.match(comment)
11
+ if md
12
+ yaml = md[0]
13
+ data = YAML.load(yaml)
14
+ data.each do |tag, desc|
15
+ create_tag(tag.to_sym, desc)
16
+ end
17
+ comment.sub(yaml, '')
18
+ else
19
+ comment
20
+ end
21
+ end
22
+
@@ -0,0 +1,19 @@
1
+ # This is an example class.
2
+ class Example
3
+
4
+ # Jump is not the kind of method you bring
5
+ # home to mother.
6
+ #
7
+ # ---
8
+ # param: how_high [Integer] height of the jump
9
+ # return: "[String] string of tartar"
10
+ # example: |
11
+ # Example.new.jump #=> "tartar"
12
+ # ...
13
+ #
14
+ def jump(how_high=nil)
15
+ "tartar"
16
+ end
17
+
18
+ end
19
+
@@ -0,0 +1,15 @@
1
+ # This is a class.
2
+ class HelloWorld
3
+
4
+ # Hello simply prints out a greeting.
5
+ #
6
+ # ---
7
+ # param: string [String] An object that responds to #to_s.
8
+ # return: nothing
9
+ # ...
10
+ #
11
+ def hello(string="World")
12
+ puts "Hello #{string}"
13
+ end
14
+
15
+ end
@@ -0,0 +1,30 @@
1
+ dir = File.expand_path(File.dirname(__FILE__))
2
+ tmp = dir + '/../../tmp'
3
+
4
+ require dir + "/../helper.rb"
5
+
6
+ # This test is design to run `yard doc` on the sample project and
7
+ # check to make sure it was produced successufully.
8
+ #
9
+ # NOTE: There is only one test b/c generation has to happen first
10
+ # and minitest will randomize the order of tests. You have fix?
11
+ #
12
+ describe "yard doc" do
13
+
14
+ before do
15
+ FileUtils.mkdir(tmp) unless File.directory?(tmp)
16
+ FileUtils.cp_r(dir + '/sample', tmp)
17
+ end
18
+
19
+ it "should generate documentation" do
20
+ Dir.chdir(tmp + '/sample') do
21
+ success = system "yard doc --plugin bird lib/"
22
+
23
+ assert(success, "failed to generate yard documentation")
24
+ assert File.directory?('doc')
25
+
26
+ # TODO: more verifications
27
+ end
28
+ end
29
+
30
+ end
@@ -0,0 +1,50 @@
1
+ require File.expand_path(File.dirname(__FILE__)) + "/../helper.rb"
2
+
3
+ require "yard"
4
+ require "yard-bird"
5
+
6
+ describe YARD::Bird::Rules do
7
+
8
+ before do
9
+ @docstring = YARD::Docstring.new <<-eof
10
+ # Duplicate some text an arbitrary number of times.
11
+ #
12
+ # text - The String to be duplicated.
13
+ # count - The Integer number of times to duplicate the text.
14
+ #
15
+ # Examples
16
+ # multiplex('Tom', 4)
17
+ # # => 'TomTomTomTom'
18
+ #
19
+ # Returns the duplicated String.
20
+ #
21
+ # Raises ArgumentError if something bad happened
22
+ eof
23
+ end
24
+
25
+ # TODO: Write some unit tests!!!
26
+
27
+ #it "should fill docstring with description" do
28
+ # @docstring.must_equal "Duplicate some text an arbitrary number of times."
29
+ #end
30
+
31
+ #it "should fill param tags" do
32
+ # tags = @docstring.tags(:param)
33
+ # tags.size.must_equal 2
34
+ # tags[0].name.must_equal 'text'
35
+ # tags[1].name.must_equal 'count'
36
+ #end
37
+
38
+ #it "should fill examples tags" do
39
+ # @docstring.tags(:example).size.must_equal 1
40
+ # @docstring.tag(:example).text.must_equal "multiplex('Tom', 4)\n # => 'TomTomTomTom'"
41
+ #end
42
+
43
+ #it "should fill return tag" do
44
+ # @docstring.tag(:return).text.must_equal "the duplicated String."
45
+ #end
46
+
47
+ #it "should fill raise tag" do
48
+ # @docstring.tag(:raise).text.must_equal "ArgumentError if something bad happened"
49
+ #end
50
+ end
metadata CHANGED
@@ -1,102 +1,103 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yard-bird
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
11
6
  platform: ruby
12
- authors:
13
- - Thomas Sawyer
7
+ authors:
8
+ - Trans
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-10 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: yard
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &24398660 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: qed
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *24398660
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &24398060 !ruby/object:Gem::Requirement
38
28
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
46
33
  type: :development
47
- version_requirements: *id002
48
- description: Yardbird is a YARD plugin that allows you, the developer, to customize your documentation parsing system.
49
- email: transfire@gmail.com
50
- executables: []
34
+ prerelease: false
35
+ version_requirements: *24398060
36
+ - !ruby/object:Gem::Dependency
37
+ name: minitest
38
+ requirement: &24397420 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *24397420
47
+ description: ! 'Yardbird is a YARD plugin that allows you, the developer, to write
48
+ documentation
51
49
 
52
- extensions: []
50
+ Your Way. Do you like TomDoc, but wish it were just a tad bit different? You can
53
51
 
54
- extra_rdoc_files:
52
+ fix that. Have some radical idea for using ASCII table in your docs? You can do
53
+
54
+ that too.'
55
+ email:
56
+ - transfire@gmail.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files:
60
+ - HISTORY.rdoc
55
61
  - README.rdoc
56
- files:
62
+ - NOTES.rdoc
63
+ - NOTICE.rdoc
64
+ files:
57
65
  - lib/yard-bird/rules.rb
58
66
  - lib/yard-bird/version.rb
59
67
  - lib/yard-bird.rb
68
+ - test/helper.rb
69
+ - test/system/sample/.yard/yaml.bird
70
+ - test/system/sample/lib/example.rb
71
+ - test/system/sample/lib/hello_world.rb
72
+ - test/system/test_yardoc.rb
73
+ - test/unit/test_rules.rb
60
74
  - HISTORY.rdoc
61
75
  - README.rdoc
76
+ - NOTES.rdoc
62
77
  - NOTICE.rdoc
63
78
  homepage: http://rubyworks.github.com/yard-bird
64
- licenses:
65
- - Apache 2.0
66
- - Apache 2.0
67
- - Apache 2.0
79
+ licenses:
80
+ - MIT
68
81
  post_install_message:
69
- rdoc_options:
70
- - --title
71
- - YARD Bird API
72
- - --main
73
- - README.rdoc
74
- require_paths:
82
+ rdoc_options: []
83
+ require_paths:
75
84
  - lib
76
- required_ruby_version: !ruby/object:Gem::Requirement
85
+ required_ruby_version: !ruby/object:Gem::Requirement
77
86
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- hash: 3
82
- segments:
83
- - 0
84
- version: "0"
85
- required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
92
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 3
91
- segments:
92
- - 0
93
- version: "0"
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
94
97
  requirements: []
95
-
96
- rubyforge_project: yard-bird
97
- rubygems_version: 1.8.2
98
+ rubyforge_project:
99
+ rubygems_version: 1.8.10
98
100
  signing_key:
99
101
  specification_version: 3
100
- summary: Write documentation your way.
102
+ summary: Documentation Your Way!
101
103
  test_files: []
102
-