jinx 2.1.1 → 2.1.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/History.md +4 -0
- data/lib/jinx.rb +0 -1
- data/lib/jinx/cli/application.rb +3 -3
- data/lib/jinx/cli/command.rb +1 -1
- data/lib/jinx/helpers/array.rb +3 -3
- data/lib/jinx/helpers/associative.rb +41 -0
- data/lib/jinx/helpers/collections.rb +0 -1
- data/lib/jinx/helpers/enumerable.rb +5 -2
- data/lib/jinx/helpers/hash.rb +1 -1
- data/lib/jinx/helpers/hashable.rb +1 -7
- data/lib/jinx/helpers/inflector.rb +1 -1
- data/lib/jinx/helpers/log.rb +63 -11
- data/lib/jinx/helpers/math.rb +20 -11
- data/lib/jinx/helpers/options.rb +4 -4
- data/lib/jinx/helpers/pretty_print.rb +0 -1
- data/lib/jinx/helpers/transitive_closure.rb +1 -1
- data/lib/jinx/helpers/uniquifier.rb +50 -17
- data/lib/jinx/helpers/visitor.rb +3 -3
- data/lib/jinx/import/java.rb +1 -1
- data/lib/jinx/importer.rb +3 -2
- data/lib/jinx/metadata/attribute_enumerator.rb +1 -1
- data/lib/jinx/metadata/dependency.rb +3 -3
- data/lib/jinx/metadata/introspector.rb +46 -42
- data/lib/jinx/metadata/inverse.rb +17 -1
- data/lib/jinx/metadata/java_property.rb +10 -10
- data/lib/jinx/metadata/propertied.rb +19 -16
- data/lib/jinx/metadata/property.rb +11 -11
- data/lib/jinx/resource.rb +86 -14
- data/lib/jinx/resource/match_visitor.rb +7 -5
- data/lib/jinx/resource/merge_visitor.rb +3 -10
- data/lib/jinx/resource/mergeable.rb +16 -16
- data/lib/jinx/resource/reference_enumerator.rb +0 -1
- data/lib/jinx/resource/reference_path_visitor.rb +1 -1
- data/lib/jinx/resource/reference_visitor.rb +5 -6
- data/lib/jinx/resource/unique.rb +1 -1
- data/lib/jinx/version.rb +1 -1
- data/test/lib/jinx/helpers/associative_test.rb +26 -0
- data/test/lib/jinx/helpers/collections_test.rb +14 -2
- data/test/lib/jinx/helpers/uniquifier_test.rb +11 -0
- metadata +9 -8
- data/Gemfile.lock +0 -27
- data/lib/jinx/helpers/error.rb +0 -15
- data/lib/jinx/helpers/key_transformer_hash.rb +0 -43
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.1.
|
5
|
+
version: 2.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- OHSU
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
14
|
-
default_executable:
|
13
|
+
date: 2012-06-12 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: bundler
|
@@ -59,7 +58,6 @@ files:
|
|
59
58
|
- .rspec
|
60
59
|
- .yardopts
|
61
60
|
- Gemfile
|
62
|
-
- Gemfile.lock
|
63
61
|
- History.md
|
64
62
|
- LEGAL
|
65
63
|
- LICENSE
|
@@ -116,6 +114,7 @@ files:
|
|
116
114
|
- lib/jinx/cli/application.rb
|
117
115
|
- lib/jinx/cli/command.rb
|
118
116
|
- lib/jinx/helpers/array.rb
|
117
|
+
- lib/jinx/helpers/associative.rb
|
119
118
|
- lib/jinx/helpers/boolean.rb
|
120
119
|
- lib/jinx/helpers/case_insensitive_hash.rb
|
121
120
|
- lib/jinx/helpers/class.rb
|
@@ -125,14 +124,12 @@ files:
|
|
125
124
|
- lib/jinx/helpers/conditional_enumerator.rb
|
126
125
|
- lib/jinx/helpers/enumerable.rb
|
127
126
|
- lib/jinx/helpers/enumerate.rb
|
128
|
-
- lib/jinx/helpers/error.rb
|
129
127
|
- lib/jinx/helpers/file_separator.rb
|
130
128
|
- lib/jinx/helpers/filter.rb
|
131
129
|
- lib/jinx/helpers/flattener.rb
|
132
130
|
- lib/jinx/helpers/hash.rb
|
133
131
|
- lib/jinx/helpers/hashable.rb
|
134
132
|
- lib/jinx/helpers/inflector.rb
|
135
|
-
- lib/jinx/helpers/key_transformer_hash.rb
|
136
133
|
- lib/jinx/helpers/lazy_hash.rb
|
137
134
|
- lib/jinx/helpers/log.rb
|
138
135
|
- lib/jinx/helpers/math.rb
|
@@ -203,6 +200,7 @@ files:
|
|
203
200
|
- test/fixtures/mixed/ext/src/mixed/Case/Example.java
|
204
201
|
- test/helper.rb
|
205
202
|
- test/lib/jinx/command_test.rb
|
203
|
+
- test/lib/jinx/helpers/associative_test.rb
|
206
204
|
- test/lib/jinx/helpers/boolean_test.rb
|
207
205
|
- test/lib/jinx/helpers/class_test.rb
|
208
206
|
- test/lib/jinx/helpers/collections_test.rb
|
@@ -215,10 +213,10 @@ files:
|
|
215
213
|
- test/lib/jinx/helpers/pretty_print_test.rb
|
216
214
|
- test/lib/jinx/helpers/stopwatch_test.rb
|
217
215
|
- test/lib/jinx/helpers/transitive_closure_test.rb
|
216
|
+
- test/lib/jinx/helpers/uniquifier_test.rb
|
218
217
|
- test/lib/jinx/helpers/visitor_test.rb
|
219
218
|
- test/lib/jinx/import/java_test.rb
|
220
219
|
- test/lib/jinx/import/mixed_case_test.rb
|
221
|
-
has_rdoc: yard
|
222
220
|
homepage: http://github.com/jinx/core
|
223
221
|
licenses:
|
224
222
|
- MIT
|
@@ -242,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
240
|
requirements: []
|
243
241
|
|
244
242
|
rubyforge_project: caruby
|
245
|
-
rubygems_version: 1.
|
243
|
+
rubygems_version: 1.8.15
|
246
244
|
signing_key:
|
247
245
|
specification_version: 3
|
248
246
|
summary: Jruby INtrospeXion facade.
|
@@ -255,6 +253,7 @@ test_files:
|
|
255
253
|
- test/fixtures/mixed/ext/src/mixed/Case/Example.java
|
256
254
|
- test/helper.rb
|
257
255
|
- test/lib/jinx/command_test.rb
|
256
|
+
- test/lib/jinx/helpers/associative_test.rb
|
258
257
|
- test/lib/jinx/helpers/boolean_test.rb
|
259
258
|
- test/lib/jinx/helpers/class_test.rb
|
260
259
|
- test/lib/jinx/helpers/collections_test.rb
|
@@ -267,6 +266,8 @@ test_files:
|
|
267
266
|
- test/lib/jinx/helpers/pretty_print_test.rb
|
268
267
|
- test/lib/jinx/helpers/stopwatch_test.rb
|
269
268
|
- test/lib/jinx/helpers/transitive_closure_test.rb
|
269
|
+
- test/lib/jinx/helpers/uniquifier_test.rb
|
270
270
|
- test/lib/jinx/helpers/visitor_test.rb
|
271
271
|
- test/lib/jinx/import/java_test.rb
|
272
272
|
- test/lib/jinx/import/mixed_case_test.rb
|
273
|
+
has_rdoc: yard
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
jinx (2.1.1)
|
5
|
-
bundler
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
diff-lcs (1.1.3)
|
11
|
-
rake (0.9.2.2)
|
12
|
-
rspec (2.9.0)
|
13
|
-
rspec-core (~> 2.9.0)
|
14
|
-
rspec-expectations (~> 2.9.0)
|
15
|
-
rspec-mocks (~> 2.9.0)
|
16
|
-
rspec-core (2.9.0)
|
17
|
-
rspec-expectations (2.9.1)
|
18
|
-
diff-lcs (~> 1.1.3)
|
19
|
-
rspec-mocks (2.9.0)
|
20
|
-
|
21
|
-
PLATFORMS
|
22
|
-
java
|
23
|
-
|
24
|
-
DEPENDENCIES
|
25
|
-
jinx!
|
26
|
-
rake
|
27
|
-
rspec (>= 2.6)
|
data/lib/jinx/helpers/error.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
module Jinx
|
2
|
-
# Prints a log message and raises an exception.
|
3
|
-
#
|
4
|
-
# @param [Class] klass the error class to raise
|
5
|
-
# @param [String] msg the error message
|
6
|
-
# @param [Exception, nil] cause the exception which caused the error
|
7
|
-
def self.fail(klass, msg, cause=nil)
|
8
|
-
logger.error(msg)
|
9
|
-
if cause then
|
10
|
-
logger.error("Caused by: #{cause.class} - #{cause}\n#{cause.backtrace.pp_s}")
|
11
|
-
end
|
12
|
-
emsg = cause ? "#{msg} - #{$!}" : msg
|
13
|
-
raise klass.new(emsg)
|
14
|
-
end
|
15
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'jinx/helpers/hashable'
|
2
|
-
|
3
|
-
module Jinx
|
4
|
-
# The KeyTransformerHash class pipes the key access argument into a transformer block before
|
5
|
-
# accessing a base Hashable, e.g.:
|
6
|
-
# hash = KeyTransformerHash.new { |key| key % 2 }
|
7
|
-
# hash[1] = :a
|
8
|
-
# hash[3] #=> :a
|
9
|
-
class KeyTransformerHash
|
10
|
-
include Hashable
|
11
|
-
|
12
|
-
# Creates a KeyTransformerHash on the optional base hash and required key transformer block.
|
13
|
-
#
|
14
|
-
# @param [Hash, nil] base the hash to transform
|
15
|
-
# @yield [key] transforms the base key
|
16
|
-
# @yieldparam key the base key to transform
|
17
|
-
def initialize(base={}, &transformer)
|
18
|
-
@base = base
|
19
|
-
@xfm = transformer
|
20
|
-
end
|
21
|
-
|
22
|
-
# Returns the value at key after this KeyTransformerHash's transformer block is applied to the key,
|
23
|
-
# or nil if the base hash does not contain an association for the transformed key.
|
24
|
-
def [](key)
|
25
|
-
@base[@xfm.call(key)]
|
26
|
-
end
|
27
|
-
|
28
|
-
# Sets the value at key after this KeyTransformerHash's transformer block is applied, or nil
|
29
|
-
# if this hash does not contain an association for the transformed key.
|
30
|
-
def []=(key, value)
|
31
|
-
@base[@xfm.call(key)] = value
|
32
|
-
end
|
33
|
-
|
34
|
-
# Delegates to the base hash.
|
35
|
-
# Note that this breaks the standard Hash contract, since
|
36
|
-
# all? { |k, v| self[k] }
|
37
|
-
# is not necessarily true because the key is transformed on access.
|
38
|
-
# @see Accessor for a KeyTransformerHash variant that restores this contract
|
39
|
-
def each(&block)
|
40
|
-
@base.each(&block)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|