fun_with_patterns 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +2 -1
- data/README.rdoc +23 -3
- data/VERSION +1 -1
- data/lib/fun_with_patterns.rb +4 -0
- data/test/helper.rb +3 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmVjYzY0ODYzZjIxYTQxNjQ5YWYzMzYwNGMzMzBjY2ZlNjA5ZTk0ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzRkMzZkOWMxMTI3NDdkMjYxNWY3ZjkxMGFiZTIzMTAzNTZlMzkwOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDA0OTllMTE0OWZmYTI2NDEyYzhhNmMyYzllM2RmMDBkNWVkYThiYjkwMjY5
|
10
|
+
MmUxMDE0MmU2OGVkY2VmYjQ1Mjc3ZmNkMjIyY2I0Njg3ZDA5NGRjNzU0YzJm
|
11
|
+
NjMxOGEzZTBmZGQ4ODk3NjRhYTg5OWYxNDkzNDdiNzcxOWYyZmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWFmODI1ZmIwMzZkM2M5ZDlmNDVhY2FkNjNlOWE5ZGJlODE1ZTljODhmOTI2
|
14
|
+
MTM0Yzk4NDQ3NjExODJmMTBjNjVkZDFlNGE2YTczNDNkYzJmODE3ODVhOThi
|
15
|
+
YzQwNzA4MTRiNTI3NzRmMzkyZTVhMzhjNWJjZjE2N2RmM2JjMDM=
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
= fun_with_patterns
|
1
|
+
= fun_with_patterns =
|
2
2
|
|
3
|
-
A collection of patterns that I seem to keep re-implementing. I'll be adding them here as I find time to revise and refactor. Until then, the only
|
3
|
+
A collection of patterns that I seem to keep re-implementing. I'll be adding them here as I find time to revise and refactor. Until then, the only ones I've gotten around to are...
|
4
4
|
|
5
5
|
|
6
|
-
== Loader Pattern
|
6
|
+
== Loader Pattern ==
|
7
7
|
|
8
8
|
The Loader pattern is a good way to customize/modularize part of your app's functionality.
|
9
9
|
|
@@ -61,6 +61,26 @@ You can get some interesting behavior by overwriting individual methods. For ex
|
|
61
61
|
|
62
62
|
|
63
63
|
|
64
|
+
== Reloadable ==
|
65
|
+
|
66
|
+
You're in the command line, developing a new class, and you find yourself forever restarting the whole project to affect changes, or constantly copy-pasting the class into the command line. Tired? Frustrated? Let .reloadable! help! Just put the method inside your class / module definition, and call Klass.reload! whenever you like.
|
67
|
+
|
68
|
+
require 'fun_with_patterns'
|
69
|
+
|
70
|
+
module SausageFest
|
71
|
+
class BratwurstCounter
|
72
|
+
reloadable!
|
73
|
+
|
74
|
+
def initialize( initial_brat_count )
|
75
|
+
... and so on
|
76
|
+
|
77
|
+
|
78
|
+
(irb) >> SausageFest::BratwurstCounter.reload!
|
79
|
+
|
80
|
+
Easy as peasy. Note, it may be buggy if the file only contains part of the definition, defines other classes as well, or performs other actions. Use at your own risk, and at great peril to your coworkers.
|
81
|
+
|
82
|
+
|
83
|
+
|
64
84
|
== Contributing to fun_with_patterns
|
65
85
|
|
66
86
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/fun_with_patterns.rb
CHANGED
@@ -10,3 +10,7 @@ FunWith::Files::RootPath.rootify( FunWith::Patterns, __FILE__.fwf_filepath.dirna
|
|
10
10
|
FunWith::VersionStrings.version( FunWith::Patterns )
|
11
11
|
|
12
12
|
FunWith::Patterns.root("lib", "fun_with").requir
|
13
|
+
|
14
|
+
Class.send( :include, FunWith::Patterns::MakeInstancesReloadable )
|
15
|
+
Module.send( :include, FunWith::Patterns::MakeInstancesReloadable )
|
16
|
+
FunWith::Patterns::Reloadable.extend( FunWith::Patterns::ClassReloaderMethod )
|
data/test/helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler'
|
3
|
+
require 'fun_with_testing'
|
4
|
+
require 'debugger'
|
3
5
|
|
4
6
|
begin
|
5
7
|
Bundler.setup(:default, :development)
|
@@ -25,4 +27,5 @@ class Test::Unit::TestCase
|
|
25
27
|
end
|
26
28
|
|
27
29
|
class FunWith::Patterns::TestCase < Test::Unit::TestCase
|
30
|
+
include FunWith::Testing::Assertions::Basics
|
28
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fun_with_patterns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryce Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fun_with_files
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fun_with_testing
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: debugger
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
description: A collection of useful patterns
|
98
126
|
email: keeputahweird@gmail.com
|
99
127
|
executables: []
|