naught 0.0.1 → 0.0.2
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.
- data/README.org +5 -5
- data/lib/naught/version.rb +1 -1
- metadata +2 -20
- data/bin/autospec +0 -16
- data/bin/coderay +0 -16
- data/bin/guard +0 -16
- data/bin/htmldiff +0 -16
- data/bin/ldiff +0 -16
- data/bin/pry +0 -16
- data/bin/rake +0 -16
- data/bin/rspec +0 -16
- data/bin/thor +0 -16
data/README.org
CHANGED
@@ -63,7 +63,7 @@ the immortal last words of James T. Kirk: "It was... /fun!/"
|
|
63
63
|
|
64
64
|
Well, what would you like to do?
|
65
65
|
|
66
|
-
*I dunno, gimme an object that responds to any message with
|
66
|
+
*I dunno, gimme an object that responds to any message with nil*
|
67
67
|
|
68
68
|
Sure thing!
|
69
69
|
|
@@ -107,7 +107,7 @@ OK.
|
|
107
107
|
That stands for "builder". Naught uses the [[http://en.wikipedia.org/wiki/Builder_pattern][Builder Pattern]] for
|
108
108
|
rolling custom null object classes.
|
109
109
|
|
110
|
-
*Whatever. What if I want a null object that has conversions to
|
110
|
+
*Whatever. What if I want a null object that has conversions to Integer, String, etc. using sensible conversions to "zero values"?*
|
111
111
|
|
112
112
|
We can do that.
|
113
113
|
|
@@ -129,7 +129,7 @@ We can do that.
|
|
129
129
|
null.to_r # => (0/1)
|
130
130
|
#+END_SRC
|
131
131
|
|
132
|
-
*Ah, but what about
|
132
|
+
*Ah, but what about implicit conversions such as #to_str? Like what if I want a null object that implicitly splats the same way as an
|
133
133
|
empty array?*
|
134
134
|
|
135
135
|
Gotcha covered.
|
@@ -156,7 +156,7 @@ Gotcha covered.
|
|
156
156
|
z # => nil
|
157
157
|
#+END_SRC
|
158
158
|
|
159
|
-
*How about a null object that only stubs out the methods from a specific class
|
159
|
+
*How about a null object that only stubs out the methods from a specific class?*
|
160
160
|
|
161
161
|
That's what =mimic= is for.
|
162
162
|
|
@@ -337,4 +337,4 @@ be included into your classes.
|
|
337
337
|
|
338
338
|
* Who's responsible
|
339
339
|
|
340
|
-
Naught is by [[http://devblog.avdi.org][Avdi Grimm]].
|
340
|
+
Naught is by [[http://devblog.avdi.org/][Avdi Grimm]].
|
data/lib/naught/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naught
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -94,16 +94,7 @@ dependencies:
|
|
94
94
|
description: Naught is a toolkit for building Null Objects
|
95
95
|
email:
|
96
96
|
- avdi@avdi.org
|
97
|
-
executables:
|
98
|
-
- autospec
|
99
|
-
- coderay
|
100
|
-
- guard
|
101
|
-
- htmldiff
|
102
|
-
- ldiff
|
103
|
-
- pry
|
104
|
-
- rake
|
105
|
-
- rspec
|
106
|
-
- thor
|
97
|
+
executables: []
|
107
98
|
extensions: []
|
108
99
|
extra_rdoc_files: []
|
109
100
|
files:
|
@@ -114,15 +105,6 @@ files:
|
|
114
105
|
- LICENSE.txt
|
115
106
|
- README.org
|
116
107
|
- Rakefile
|
117
|
-
- bin/autospec
|
118
|
-
- bin/coderay
|
119
|
-
- bin/guard
|
120
|
-
- bin/htmldiff
|
121
|
-
- bin/ldiff
|
122
|
-
- bin/pry
|
123
|
-
- bin/rake
|
124
|
-
- bin/rspec
|
125
|
-
- bin/thor
|
126
108
|
- lib/naught.rb
|
127
109
|
- lib/naught/null_class_builder.rb
|
128
110
|
- lib/naught/null_class_builder/commands/define_explicit_conversions.rb
|
data/bin/autospec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'autospec' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('rspec-core', 'autospec')
|
data/bin/coderay
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'coderay' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('coderay', 'coderay')
|
data/bin/guard
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'guard' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('guard', 'guard')
|
data/bin/htmldiff
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'htmldiff' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('diff-lcs', 'htmldiff')
|
data/bin/ldiff
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'ldiff' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('diff-lcs', 'ldiff')
|
data/bin/pry
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'pry' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('pry', 'pry')
|
data/bin/rake
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'rake' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('rake', 'rake')
|
data/bin/rspec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'rspec' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/thor
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'thor' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('thor', 'thor')
|