active_doc 0.1.0

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.
@@ -0,0 +1 @@
1
+ require File.expand_path("../../lib/active_doc.rb", __FILE__)
@@ -0,0 +1,53 @@
1
+ class PhoneNumber
2
+ include ActiveDoc
3
+
4
+ takes :contact_name, String, :desc => "Name of person"
5
+ takes :number, /^\d+$/, :desc => "Phone number"
6
+ takes :options, Hash do
7
+ takes :category, String, :desc => "Category of this contact"
8
+ end
9
+
10
+ def initialize(contact_name, number, options = {})
11
+
12
+ end
13
+ end
14
+ class PhoneBook
15
+ include ActiveDoc
16
+ attr_accessor :owner
17
+
18
+ def initialize(owner)
19
+ @numbers = []
20
+ PhoneBook.register(self)
21
+ end
22
+
23
+ takes :contact_name, :ref => "PhoneNumber#initialize"
24
+ takes :number, :ref => "PhoneNumber#initialize"
25
+ takes :options, :ref => "PhoneNumber#initialize"
26
+
27
+ def add(contact_name, number, options = {})
28
+ @numbers << PhoneNumber.new(contact_name, number, options)
29
+ end
30
+
31
+ takes :owner, String
32
+
33
+ def self.find_for_owner(owner)
34
+ @phone_books && @phone_books[owner]
35
+ end
36
+
37
+ class << self
38
+ takes :phone_book, PhoneBook
39
+
40
+ def register(phone_book)
41
+ @phone_books ||= {}
42
+ @phone_books[phone_book.owner] = phone_book
43
+ end
44
+ end
45
+
46
+ def self.phone_books
47
+ return @phone_books.values
48
+ end
49
+
50
+ def size
51
+ return @numbers.size
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_doc
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - "Ivan Ne\xC4\x8Das"
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-03-07 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 8
31
+ - 7
32
+ version: 0.8.7
33
+ type: :development
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 2
45
+ - 3
46
+ - 0
47
+ version: 2.3.0
48
+ type: :development
49
+ version_requirements: *id002
50
+ description: DSL for executable documentation of your code.
51
+ email: necasik@gmail.com
52
+ executables: []
53
+
54
+ extensions: []
55
+
56
+ extra_rdoc_files:
57
+ - LICENSE
58
+ - README.rdoc
59
+ - History.txt
60
+ files:
61
+ - .gitignore
62
+ - Gemfile
63
+ - History.txt
64
+ - LICENSE
65
+ - README.rdoc
66
+ - active_doc.gemspec
67
+ - lib/active_doc.rb
68
+ - lib/active_doc/described_method.rb
69
+ - lib/active_doc/descriptions.rb
70
+ - lib/active_doc/descriptions/method_argument_description.rb
71
+ - lib/active_doc/rake/task.rb
72
+ - lib/active_doc/rdoc_generator.rb
73
+ - spec/active_doc/method_argument_description_spec.rb
74
+ - spec/active_doc/rdoc_generator_spec.rb
75
+ - spec/spec_helper.rb
76
+ - spec/support/documented_class.rb
77
+ has_rdoc: true
78
+ homepage: http://github.com/necasik/active_doc
79
+ licenses: []
80
+
81
+ post_install_message: "\n\
82
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n\
83
+ Thank you for installing active_doc-0.1.0.\n\
84
+ (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n"
85
+ rdoc_options:
86
+ - --charset=UTF-8
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ segments:
95
+ - 0
96
+ version: "0"
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ requirements: []
106
+
107
+ rubyforge_project:
108
+ rubygems_version: 1.3.7
109
+ signing_key:
110
+ specification_version: 3
111
+ summary: active_doc-0.1.0
112
+ test_files:
113
+ - spec/active_doc/method_argument_description_spec.rb
114
+ - spec/active_doc/rdoc_generator_spec.rb
115
+ - spec/spec_helper.rb
116
+ - spec/support/documented_class.rb