dogestrings 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fc928ed9814e34916e5b4a036d9d8d88be5f2db7
4
+ data.tar.gz: a247bb3fff8cd7cd3239f09c07d4c01733e6e644
5
+ SHA512:
6
+ metadata.gz: 201e1abcdd81f4184bb3fa9cd9505328d9a017db82f293a2a387667a0e87f8d06c0af15325969d733364df7030844e38c12c233eb2ccac7b83a2b1ba5b4d4cba
7
+ data.tar.gz: cd2da77c415be293bc89b0d49ce99c361d5c7f9c56e502de61d5e9d52b1f2bbe3a16e6aaca9e05470f1b70672727c92571abd670c8ee64eddc018d4b34255b35
data/.gitignore ADDED
@@ -0,0 +1,48 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # bundler
12
+ .bundle
13
+
14
+ # jeweler generated
15
+ pkg
16
+
17
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
18
+ #
19
+ # * Create a file at ~/.gitignore
20
+ # * Include files you want ignored
21
+ # * Run: git config --global core.excludesfile ~/.gitignore
22
+ #
23
+ # After doing this, these files will be ignored in all your git projects,
24
+ # saving you from having to 'pollute' every project you touch with them
25
+ #
26
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
27
+ #
28
+ # For MacOS:
29
+ #
30
+ #.DS_Store
31
+
32
+ # For TextMate
33
+ #*.tmproj
34
+ #tmtags
35
+
36
+ # For emacs:
37
+ #*~
38
+ #\#*
39
+ #.\#*
40
+
41
+ # For vim:
42
+ #*.swp
43
+
44
+ # For redcar:
45
+ #.redcar
46
+
47
+ # For rubinius:
48
+ #*.rbc
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use ruby-2.1.1@dogestrings
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "http://rubygems.org"
2
+
3
+ group :development do
4
+ gem "rspec", "~> 3.3.0"
5
+ gem "bundler", "~> 1.10.5"
6
+ gem "jeweler", "~> 1.6.4"
7
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.2.5)
5
+ git (1.2.9.1)
6
+ jeweler (1.6.4)
7
+ bundler (~> 1.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rake (10.4.2)
11
+ rspec (3.3.0)
12
+ rspec-core (~> 3.3.0)
13
+ rspec-expectations (~> 3.3.0)
14
+ rspec-mocks (~> 3.3.0)
15
+ rspec-core (3.3.1)
16
+ rspec-support (~> 3.3.0)
17
+ rspec-expectations (3.3.0)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.3.0)
20
+ rspec-mocks (3.3.1)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.3.0)
23
+ rspec-support (3.3.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ bundler (~> 1.10.5)
30
+ jeweler (~> 1.6.4)
31
+ rspec (~> 3.3.0)
32
+
33
+ BUNDLED WITH
34
+ 1.10.5
data/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
data/README.markdown ADDED
@@ -0,0 +1,11 @@
1
+ # Dogestrings
2
+
3
+ Hardcore docstrings for Ruby.
4
+
5
+ <img src="https://raw.githubusercontent.com/fogus/dogestrings/master/docs/logo.jpg" height="300px" width="300px">
6
+
7
+ # License
8
+
9
+ Copyright 2015 Mike Fogus
10
+
11
+ Licensed under the LGPL v3.0. https://www.gnu.org/licenses/lgpl-3.0.en.html
data/Rakefile ADDED
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "dogestrings"
18
+ gem.homepage = "http://fogus.me/fun"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Hardcore docstrings for Ruby}
21
+ gem.description = %Q{TODO: longer description of your gem}
22
+ gem.email = "me[at]fogus[dot]me"
23
+ gem.authors = ["fogus"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :default => :spec
40
+
41
+ require 'rdoc/task'
42
+ Rake::RDocTask.new do |rdoc|
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
44
+
45
+ rdoc.rdoc_dir = 'rdoc'
46
+ rdoc.title = "dogestrings #{version}"
47
+ rdoc.rdoc_files.include('README*')
48
+ rdoc.rdoc_files.include('lib/**/*.rb')
49
+ end
data/docs/logo.jpg ADDED
Binary file
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+ require File.expand_path('../lib/dogestrings/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = 'dogestrings'
6
+ gem.description = %q{Hardcore docstrings for Ruby.}
7
+ gem.authors = ['Fogus']
8
+ gem.email = ['me-at-fogus-dot-me']
9
+
10
+ gem.version = Dogestrings::VERSION
11
+ gem.files = `git ls-files`.split("\n")
12
+ gem.homepage = 'http://github.com/fogus/dogestrings'
13
+ gem.require_paths = ['lib']
14
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if gem.respond_to? :required_rubygems_version=
15
+ gem.summary = gem.description
16
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ end
@@ -0,0 +1,67 @@
1
+ class Module
2
+ def ___ ds
3
+ @last_docstring = ds
4
+ end
5
+
6
+ def describe &printer
7
+ printer_impl = printer || lambda { |method_name|
8
+ 20.times { print '-' }
9
+ puts
10
+
11
+ puts "#{self.inspect}##{method_name.to_s}"
12
+ puts "(args go here)"
13
+ puts " #{self.doc_for method_name}"
14
+ puts
15
+ }
16
+
17
+ puts "Instance Methods"
18
+ (self.instance_methods - Object.instance_methods).sort.each &printer_impl
19
+
20
+ puts "Class Methods"
21
+ (self.methods - Object.methods).sort.each &printer_impl
22
+
23
+ @docstrings.count
24
+ end
25
+
26
+ def doc_for method_name
27
+ @docstrings[method_name]
28
+ end
29
+
30
+ private
31
+
32
+ alias old_method_added method_added
33
+
34
+ def do_magic method_name
35
+ if defined? @last_docstring
36
+ (@docstrings ||= {})[method_name] = @last_docstring
37
+ @last_docstring = nil
38
+ end
39
+
40
+ old_method_added method_name
41
+ end
42
+
43
+ def singleton_method_added method_name
44
+ do_magic method_name
45
+ end
46
+
47
+ def method_added method_name
48
+ do_magic method_name
49
+ end
50
+ end
51
+
52
+ <<-philos
53
+
54
+ Fogus refers first to Nietzsche and his figure of thought that all interactions
55
+ and interpretations of the external world through the lens of an individual
56
+ perspective are completed. Even something like "truth" is therefore subject to
57
+ constant interpretation, occupational change, and the intake of alternative
58
+ viewpoints is essential in order to reach a higher level of knowledge.
59
+
60
+ For the transmission of this figure of thought on the IT world Fogus notes that
61
+ just a software developer of industry-high standards and best practices are
62
+ shaped, are ultimately subjective in nature. Were strongly dependent on the
63
+ subjective views of the developers of one's own history of the learned languages,
64
+ and here comes again programming pioneer Alan Perlis into play...
65
+
66
+ philos
67
+
@@ -0,0 +1,3 @@
1
+ module Dogestrings
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,33 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ class Foo
4
+ ___ "Ants!"
5
+ def self.bar
6
+ "blah"
7
+ end
8
+
9
+ ___ "Monkeys!"
10
+ def baz
11
+ "boop"
12
+ end
13
+
14
+ def qux x
15
+ [x]
16
+ end
17
+
18
+ class << self
19
+ ___ "Chins!"
20
+ def frob x, y
21
+ [x,y]
22
+ end
23
+ end
24
+ end
25
+
26
+ describe "Foo" do
27
+ it "has the expected docstrings" do
28
+ expect(Foo.doc_for(:bar)).to eq "Ants!"
29
+ expect(Foo.doc_for(:baz)).to eq "Monkeys!"
30
+ expect(Foo.doc_for(:qux)).to be nil
31
+ Foo.describe
32
+ end
33
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'dogestrings'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dogestrings
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Fogus
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Hardcore docstrings for Ruby.
14
+ email:
15
+ - me-at-fogus-dot-me
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".rspec"
22
+ - ".rvmrc"
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - LICENSE
26
+ - README.markdown
27
+ - Rakefile
28
+ - docs/logo.jpg
29
+ - dogestrings.gemspec
30
+ - lib/dogestrings.rb
31
+ - lib/dogestrings/version.rb
32
+ - spec/dogestrings_spec.rb
33
+ - spec/spec_helper.rb
34
+ homepage: http://github.com/fogus/dogestrings
35
+ licenses: []
36
+ metadata: {}
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.3.6
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 2.4.6
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Hardcore docstrings for Ruby.
57
+ test_files:
58
+ - spec/dogestrings_spec.rb
59
+ - spec/spec_helper.rb