pay_dirt 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pay_dirt/base.rb +1 -1
- data/lib/pay_dirt/use_case.rb +17 -1
- data/lib/pay_dirt/version.rb +1 -1
- data/pay_dirt.gemspec +2 -2
- metadata +33 -17
- checksums.yaml +0 -7
data/lib/pay_dirt/base.rb
CHANGED
data/lib/pay_dirt/use_case.rb
CHANGED
@@ -1,15 +1,28 @@
|
|
1
1
|
module PayDirt
|
2
2
|
module UseCase
|
3
3
|
def self.included(base)
|
4
|
+
# @overload load_options(keys, options)
|
5
|
+
# Sets instance variables for all provided key value pairs in +options+.
|
6
|
+
# Raises error if required keys cannot be fond in options.
|
7
|
+
# @param [List<String,Symbol>] keys a List of (Strings or Symbols) that must be contained in +options+
|
8
|
+
# @param [Hash] options hash of options (dependencies)
|
9
|
+
# @overload load_options(options)
|
10
|
+
# Sets instance variables for all provided key value pairs in +options+
|
11
|
+
# @param [Hash] options hash of options (dependencies)
|
12
|
+
# @api public
|
4
13
|
def load_options(*option_names, options)
|
5
14
|
# Load required options
|
6
15
|
option_names.each { |o| options = load_option(o, options) }
|
7
|
-
|
16
|
+
|
8
17
|
# Load remaining options
|
9
18
|
options.each_key { |o| options = load_option(o, options) }
|
10
19
|
end
|
11
20
|
|
12
21
|
private
|
22
|
+
# @param [Symbol,String] option The option to load from the provided options hash.
|
23
|
+
# @param [Hash] options The provided hash of options
|
24
|
+
# @return [Hash] Deletes the key value pair at `option` and returns the remaining options hash
|
25
|
+
# @api private
|
13
26
|
def load_option(option, options)
|
14
27
|
instance_variable_set("@#{option}", fetch(option, options))
|
15
28
|
options.delete(option)
|
@@ -17,6 +30,9 @@ module PayDirt
|
|
17
30
|
return options
|
18
31
|
end
|
19
32
|
|
33
|
+
# @param [Symbol, String] opt the key to fetch from +opts+
|
34
|
+
# @param [Hash] opts the hash of options from which +opt+ will be fetched
|
35
|
+
# @api private
|
20
36
|
def fetch(opt, opts)
|
21
37
|
opts.fetch(opt.to_sym) { raise "Missing required option: #{opt}" }
|
22
38
|
end
|
data/lib/pay_dirt/version.rb
CHANGED
data/pay_dirt.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
|
|
15
15
|
(or more Ruby gems)
|
16
16
|
}
|
17
17
|
s.summary = %q{
|
18
|
-
|
19
|
-
|
18
|
+
Reduce a towering codebase to modular
|
19
|
+
rubble (or more rubygems) with pay_dirt
|
20
20
|
}
|
21
21
|
|
22
22
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,72 +1,81 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pay_dirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Tad Hosford
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: minitest
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: thor
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: coveralls
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- - '>='
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- - '>='
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rake
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- - '>='
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- - '>='
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
|
-
description: "\n Provides the basic building blocks\n of
|
78
|
+
description: ! "\n Provides the basic building blocks\n of
|
70
79
|
a pattern capable of reducing a\n towering codebase to modular
|
71
80
|
rubble\n (or more Ruby gems)\n "
|
72
81
|
email:
|
@@ -95,25 +104,32 @@ files:
|
|
95
104
|
- test/unit/pay_dirt/use_case_test.rb
|
96
105
|
homepage: http://github.com/rthbound/pay_dirt
|
97
106
|
licenses: []
|
98
|
-
metadata: {}
|
99
107
|
post_install_message:
|
100
108
|
rdoc_options: []
|
101
109
|
require_paths:
|
102
110
|
- lib
|
103
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
104
113
|
requirements:
|
105
|
-
- - '>='
|
114
|
+
- - ! '>='
|
106
115
|
- !ruby/object:Gem::Version
|
107
116
|
version: '0'
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
hash: -935381315
|
108
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
109
122
|
requirements:
|
110
|
-
- - '>='
|
123
|
+
- - ! '>='
|
111
124
|
- !ruby/object:Gem::Version
|
112
125
|
version: '0'
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
hash: -935381315
|
113
129
|
requirements: []
|
114
130
|
rubyforge_project:
|
115
|
-
rubygems_version:
|
131
|
+
rubygems_version: 1.8.25
|
116
132
|
signing_key:
|
117
|
-
specification_version:
|
118
|
-
summary:
|
133
|
+
specification_version: 3
|
134
|
+
summary: Reduce a towering codebase to modular rubble (or more rubygems) with pay_dirt
|
119
135
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: c384f986821d54bb9a87d60d500ca599162c33d0
|
4
|
-
data.tar.gz: b608fe834f4050ccabac596c2f577cd32b380b9f
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 8fc872999a33075bf0d80de2ae90c1d0b4f5fa47cd0229e168ee826d3c16ae02c6966cda408c04ca56761381b2ed04e5ec0cb4c8388ad605dba54366ff553fda
|
7
|
-
data.tar.gz: d44a64394081bd6ede1a1359606c00ed3e0e073fb43252d12a4303ce025aca60444b3e906163df30e3b68598a36e2cc6ecdb2a14bcc9b8de44c8ab65a2835270
|