rom-mapper 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rspec +1 -1
  4. data/.travis.yml +19 -13
  5. data/{Changelog.md → CHANGELOG.md} +6 -0
  6. data/Gemfile +23 -10
  7. data/README.md +17 -12
  8. data/Rakefile +12 -4
  9. data/lib/rom-mapper.rb +6 -15
  10. data/lib/rom/header.rb +195 -0
  11. data/lib/rom/header/attribute.rb +184 -0
  12. data/lib/rom/mapper.rb +63 -100
  13. data/lib/rom/mapper/attribute_dsl.rb +477 -0
  14. data/lib/rom/mapper/dsl.rb +120 -0
  15. data/lib/rom/mapper/model_dsl.rb +55 -0
  16. data/lib/rom/mapper/version.rb +3 -7
  17. data/lib/rom/model_builder.rb +99 -0
  18. data/lib/rom/processor.rb +28 -0
  19. data/lib/rom/processor/transproc.rb +388 -0
  20. data/rakelib/benchmark.rake +15 -0
  21. data/rakelib/mutant.rake +16 -0
  22. data/rakelib/rubocop.rake +18 -0
  23. data/rom-mapper.gemspec +7 -6
  24. data/spec/spec_helper.rb +32 -33
  25. data/spec/support/constant_leak_finder.rb +14 -0
  26. data/spec/support/mutant.rb +10 -0
  27. data/spec/unit/rom/mapper/dsl_spec.rb +467 -0
  28. data/spec/unit/rom/mapper_spec.rb +83 -0
  29. data/spec/unit/rom/processor/transproc_spec.rb +448 -0
  30. metadata +68 -89
  31. data/.ruby-version +0 -1
  32. data/Gemfile.devtools +0 -55
  33. data/config/devtools.yml +0 -2
  34. data/config/flay.yml +0 -3
  35. data/config/flog.yml +0 -2
  36. data/config/mutant.yml +0 -3
  37. data/config/reek.yml +0 -103
  38. data/config/rubocop.yml +0 -45
  39. data/lib/rom/mapper/attribute.rb +0 -31
  40. data/lib/rom/mapper/dumper.rb +0 -27
  41. data/lib/rom/mapper/loader.rb +0 -22
  42. data/lib/rom/mapper/loader/allocator.rb +0 -32
  43. data/lib/rom/mapper/loader/attribute_writer.rb +0 -23
  44. data/lib/rom/mapper/loader/object_builder.rb +0 -28
  45. data/spec/shared/unit/loader_call.rb +0 -13
  46. data/spec/shared/unit/loader_identity.rb +0 -13
  47. data/spec/shared/unit/mapper_context.rb +0 -13
  48. data/spec/unit/rom/mapper/call_spec.rb +0 -32
  49. data/spec/unit/rom/mapper/class_methods/build_spec.rb +0 -64
  50. data/spec/unit/rom/mapper/dump_spec.rb +0 -15
  51. data/spec/unit/rom/mapper/dumper/call_spec.rb +0 -29
  52. data/spec/unit/rom/mapper/dumper/identity_spec.rb +0 -28
  53. data/spec/unit/rom/mapper/header/each_spec.rb +0 -28
  54. data/spec/unit/rom/mapper/header/element_reader_spec.rb +0 -25
  55. data/spec/unit/rom/mapper/header/keys_spec.rb +0 -32
  56. data/spec/unit/rom/mapper/identity_from_tuple_spec.rb +0 -15
  57. data/spec/unit/rom/mapper/identity_spec.rb +0 -15
  58. data/spec/unit/rom/mapper/load_spec.rb +0 -15
  59. data/spec/unit/rom/mapper/loader/allocator/call_spec.rb +0 -7
  60. data/spec/unit/rom/mapper/loader/allocator/identity_spec.rb +0 -7
  61. data/spec/unit/rom/mapper/loader/attribute_writer/call_spec.rb +0 -7
  62. data/spec/unit/rom/mapper/loader/attribute_writer/identity_spec.rb +0 -7
  63. data/spec/unit/rom/mapper/loader/object_builder/call_spec.rb +0 -7
  64. data/spec/unit/rom/mapper/loader/object_builder/identity_spec.rb +0 -7
  65. data/spec/unit/rom/mapper/model_spec.rb +0 -11
  66. data/spec/unit/rom/mapper/new_object_spec.rb +0 -14
metadata CHANGED
@@ -1,178 +1,157 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Piotr Solnica
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
11
+ date: 2015-08-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: concord
14
+ name: transproc
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 0.1.4
19
+ version: '0.3'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: 0.1.4
26
+ version: '0.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: equalizer
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: 0.0.7
33
+ version: '0.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.0.10
38
37
  type: :runtime
39
38
  prerelease: false
40
39
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ~>
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.0'
44
+ - - ">="
44
45
  - !ruby/object:Gem::Version
45
- version: 0.0.7
46
+ version: 0.0.10
46
47
  - !ruby/object:Gem::Dependency
47
- name: descendants_tracker
48
+ name: rom-support
48
49
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
50
  requirements:
51
- - - ~>
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.1
53
+ version: '0.1'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.1.0
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
60
  requirements:
59
- - - ~>
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.1'
64
+ - - ">="
60
65
  - !ruby/object:Gem::Version
61
- version: 0.0.1
66
+ version: 0.1.0
62
67
  - !ruby/object:Gem::Dependency
63
- name: abstract_type
68
+ name: rake
64
69
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
70
  requirements:
67
- - - ~>
71
+ - - "~>"
68
72
  - !ruby/object:Gem::Version
69
- version: 0.0.6
70
- type: :runtime
73
+ version: '10.3'
74
+ type: :development
71
75
  prerelease: false
72
76
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
77
  requirements:
75
- - - ~>
78
+ - - "~>"
76
79
  - !ruby/object:Gem::Version
77
- version: 0.0.6
80
+ version: '10.3'
78
81
  - !ruby/object:Gem::Dependency
79
- name: adamantium
82
+ name: rspec
80
83
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
84
  requirements:
83
- - - ~>
85
+ - - "~>"
84
86
  - !ruby/object:Gem::Version
85
- version: '0.1'
86
- type: :runtime
87
+ version: '3.3'
88
+ type: :development
87
89
  prerelease: false
88
90
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
91
  requirements:
91
- - - ~>
92
+ - - "~>"
92
93
  - !ruby/object:Gem::Version
93
- version: '0.1'
94
- description: rom-mapper
94
+ version: '3.3'
95
+ description: ROM mapper component
95
96
  email: piotr.solnica@gmail.com
96
97
  executables: []
97
98
  extensions: []
98
99
  extra_rdoc_files: []
99
100
  files:
100
- - .gitignore
101
- - .rspec
102
- - .ruby-gemset
103
- - .ruby-version
104
- - .travis.yml
105
- - Changelog.md
101
+ - ".gitignore"
102
+ - ".rspec"
103
+ - ".ruby-gemset"
104
+ - ".travis.yml"
105
+ - CHANGELOG.md
106
106
  - Gemfile
107
- - Gemfile.devtools
108
107
  - Guardfile
109
108
  - LICENSE
110
109
  - README.md
111
110
  - Rakefile
112
- - config/devtools.yml
113
- - config/flay.yml
114
- - config/flog.yml
115
- - config/mutant.yml
116
- - config/reek.yml
117
- - config/rubocop.yml
118
111
  - lib/rom-mapper.rb
112
+ - lib/rom/header.rb
113
+ - lib/rom/header/attribute.rb
119
114
  - lib/rom/mapper.rb
120
- - lib/rom/mapper/attribute.rb
121
- - lib/rom/mapper/dumper.rb
115
+ - lib/rom/mapper/attribute_dsl.rb
116
+ - lib/rom/mapper/dsl.rb
122
117
  - lib/rom/mapper/header.rb
123
- - lib/rom/mapper/loader.rb
124
- - lib/rom/mapper/loader/allocator.rb
125
- - lib/rom/mapper/loader/attribute_writer.rb
126
- - lib/rom/mapper/loader/object_builder.rb
118
+ - lib/rom/mapper/model_dsl.rb
127
119
  - lib/rom/mapper/version.rb
120
+ - lib/rom/model_builder.rb
121
+ - lib/rom/processor.rb
122
+ - lib/rom/processor/transproc.rb
123
+ - rakelib/benchmark.rake
124
+ - rakelib/mutant.rake
125
+ - rakelib/rubocop.rake
128
126
  - rom-mapper.gemspec
129
- - spec/shared/unit/loader_call.rb
130
- - spec/shared/unit/loader_identity.rb
131
- - spec/shared/unit/mapper_context.rb
132
127
  - spec/spec_helper.rb
133
- - spec/unit/rom/mapper/call_spec.rb
134
- - spec/unit/rom/mapper/class_methods/build_spec.rb
135
- - spec/unit/rom/mapper/dump_spec.rb
136
- - spec/unit/rom/mapper/dumper/call_spec.rb
137
- - spec/unit/rom/mapper/dumper/identity_spec.rb
138
- - spec/unit/rom/mapper/header/each_spec.rb
139
- - spec/unit/rom/mapper/header/element_reader_spec.rb
140
- - spec/unit/rom/mapper/header/keys_spec.rb
141
- - spec/unit/rom/mapper/identity_from_tuple_spec.rb
142
- - spec/unit/rom/mapper/identity_spec.rb
143
- - spec/unit/rom/mapper/load_spec.rb
144
- - spec/unit/rom/mapper/loader/allocator/call_spec.rb
145
- - spec/unit/rom/mapper/loader/allocator/identity_spec.rb
146
- - spec/unit/rom/mapper/loader/attribute_writer/call_spec.rb
147
- - spec/unit/rom/mapper/loader/attribute_writer/identity_spec.rb
148
- - spec/unit/rom/mapper/loader/object_builder/call_spec.rb
149
- - spec/unit/rom/mapper/loader/object_builder/identity_spec.rb
150
- - spec/unit/rom/mapper/model_spec.rb
151
- - spec/unit/rom/mapper/new_object_spec.rb
128
+ - spec/support/constant_leak_finder.rb
129
+ - spec/support/mutant.rb
130
+ - spec/unit/rom/mapper/dsl_spec.rb
131
+ - spec/unit/rom/mapper_spec.rb
132
+ - spec/unit/rom/processor/transproc_spec.rb
152
133
  homepage: http://rom-rb.org
153
134
  licenses:
154
135
  - MIT
136
+ metadata: {}
155
137
  post_install_message:
156
138
  rdoc_options: []
157
139
  require_paths:
158
140
  - lib
159
141
  required_ruby_version: !ruby/object:Gem::Requirement
160
- none: false
161
142
  requirements:
162
- - - ! '>='
143
+ - - ">="
163
144
  - !ruby/object:Gem::Version
164
145
  version: '0'
165
146
  required_rubygems_version: !ruby/object:Gem::Requirement
166
- none: false
167
147
  requirements:
168
- - - ! '>='
148
+ - - ">="
169
149
  - !ruby/object:Gem::Version
170
150
  version: '0'
171
151
  requirements: []
172
152
  rubyforge_project:
173
- rubygems_version: 1.8.23
153
+ rubygems_version: 2.4.5
174
154
  signing_key:
175
- specification_version: 3
176
- summary: rom-mapper
155
+ specification_version: 4
156
+ summary: ROM mapper component
177
157
  test_files: []
178
- has_rdoc:
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 1.9.3
data/Gemfile.devtools DELETED
@@ -1,55 +0,0 @@
1
- # encoding: utf-8
2
-
3
- group :development do
4
- gem 'rake', '~> 10.1.0'
5
- gem 'rspec', '~> 2.14.1'
6
- gem 'yard', '~> 0.8.7'
7
- end
8
-
9
- group :yard do
10
- gem 'kramdown', '~> 1.1.0'
11
- end
12
-
13
- group :guard do
14
- gem 'guard', '~> 1.8.1'
15
- gem 'guard-bundler', '~> 1.0.0'
16
- gem 'guard-rspec', '~> 3.0.2'
17
- gem 'guard-rubocop', '~> 0.2.0'
18
- gem 'guard-mutant', '~> 0.0.1'
19
-
20
- # file system change event handling
21
- gem 'listen', '~> 1.2.2'
22
- gem 'rb-fchange', '~> 0.0.6', require: false
23
- gem 'rb-fsevent', '~> 0.9.3', require: false
24
- gem 'rb-inotify', '~> 0.9.0', require: false
25
-
26
- # notification handling
27
- gem 'libnotify', '~> 0.8.0', require: false
28
- gem 'rb-notifu', '~> 0.0.4', require: false
29
- gem 'terminal-notifier-guard', '~> 1.5.3', require: false
30
- end
31
-
32
- group :metrics do
33
- gem 'coveralls', '~> 0.6.7'
34
- gem 'flay', '~> 2.4.0'
35
- gem 'flog', '~> 4.1.1'
36
- gem 'reek', '~> 1.3.2'
37
- gem 'rubocop', '~> 0.11.0'
38
- gem 'simplecov', '~> 0.7.1'
39
- gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
40
-
41
- platforms :ruby_19, :ruby_20 do
42
- gem 'mutant', git: 'https://github.com/mbj/mutant.git'
43
- gem 'yard-spellcheck', '~> 0.1.5'
44
- end
45
- end
46
-
47
- group :benchmarks do
48
- gem 'rbench', '~> 0.2.3'
49
- end
50
-
51
- platform :jruby do
52
- group :jruby do
53
- gem 'jruby-openssl', '~> 0.8.5'
54
- end
55
- end
data/config/devtools.yml DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- unit_test_timeout: 0.1
data/config/flay.yml DELETED
@@ -1,3 +0,0 @@
1
- ---
2
- threshold: 7
3
- total_score: 55
data/config/flog.yml DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- threshold: 13.7
data/config/mutant.yml DELETED
@@ -1,3 +0,0 @@
1
- ---
2
- name: rom-mapper
3
- namespace: ROM::Mapper
data/config/reek.yml DELETED
@@ -1,103 +0,0 @@
1
- ---
2
- Attribute:
3
- enabled: true
4
- exclude: []
5
- BooleanParameter:
6
- enabled: true
7
- exclude: []
8
- ClassVariable:
9
- enabled: true
10
- exclude: []
11
- ControlParameter:
12
- enabled: true
13
- exclude: []
14
- DataClump:
15
- enabled: true
16
- exclude: []
17
- max_copies: 2
18
- min_clump_size: 2
19
- DuplicateMethodCall:
20
- enabled: false
21
- FeatureEnvy:
22
- enabled: true
23
- exclude:
24
- - ROM::Mapper::Loader::Allocator#call
25
- - ROM::Mapper::Loader::AttributeWriter#call
26
- IrresponsibleModule:
27
- enabled: true
28
- exclude: []
29
- LongParameterList:
30
- enabled: true
31
- exclude:
32
- - ROM::Mapper#self.build
33
- max_params: 2
34
- LongYieldList:
35
- enabled: true
36
- exclude: []
37
- max_params: 2
38
- NestedIterators:
39
- enabled: true
40
- max_allowed_nesting: 1
41
- ignore_iterators: []
42
- exclude:
43
- - ROM::Mapper::Header#keys
44
- NilCheck:
45
- enabled: true
46
- exclude: []
47
- RepeatedConditional:
48
- enabled: true
49
- exclude: []
50
- max_ifs: 1
51
- TooManyInstanceVariables:
52
- enabled: true
53
- exclude: []
54
- max_instance_variables: 3
55
- TooManyMethods:
56
- enabled: true
57
- exclude: []
58
- max_methods: 10
59
- TooManyStatements:
60
- enabled: true
61
- exclude:
62
- - each
63
- - ROM::Mapper#self.build
64
- - ROM::Mapper::Header#self.build
65
- max_statements: 4
66
- UncommunicativeMethodName:
67
- enabled: true
68
- exclude: []
69
- reject:
70
- - !ruby/regexp /^[a-z]$/
71
- - !ruby/regexp /[0-9]$/
72
- - !ruby/regexp /[A-Z]/
73
- accept: []
74
- UncommunicativeModuleName:
75
- enabled: true
76
- exclude: []
77
- reject:
78
- - !ruby/regexp /^.$/
79
- - !ruby/regexp /[0-9]$/
80
- accept: []
81
- UncommunicativeParameterName:
82
- enabled: true
83
- exclude: []
84
- reject:
85
- - !ruby/regexp /^.$/
86
- - !ruby/regexp /[0-9]$/
87
- - !ruby/regexp /[A-Z]/
88
- accept: []
89
- UncommunicativeVariableName:
90
- enabled: true
91
- exclude: []
92
- reject:
93
- - !ruby/regexp /^.$/
94
- - !ruby/regexp /[0-9]$/
95
- - !ruby/regexp /[A-Z]/
96
- accept: []
97
- UnusedParameters:
98
- enabled: true
99
- exclude: []
100
- UtilityFunction:
101
- enabled: true
102
- exclude: []
103
- max_helper_calls: 0
data/config/rubocop.yml DELETED
@@ -1,45 +0,0 @@
1
- AllCops:
2
- Includes:
3
- - '**/*.rake'
4
- - 'Gemfile'
5
- - 'Gemfile.devtools'
6
- Excludes:
7
- - '**/vendor/**'
8
-
9
- # Avoid parameter lists longer than five parameters.
10
- ParameterLists:
11
- Max: 3
12
- CountKeywordArgs: true
13
-
14
- # Avoid more than `Max` levels of nesting.
15
- BlockNesting:
16
- Max: 3
17
-
18
- # Align with the style guide.
19
- CollectionMethods:
20
- PreferredMethods:
21
- collect: 'map'
22
- inject: 'reduce'
23
- find: 'detect'
24
- find_all: 'select'
25
-
26
- # Do not force public/protected/private keyword to be indented at the same
27
- # level as the def keyword. My personal preference is to outdent these keywords
28
- # because I think when scanning code it makes it easier to identify the
29
- # sections of code and visually separate them. When the keyword is at the same
30
- # level I think it sort of blends in with the def keywords and makes it harder
31
- # to scan the code and see where the sections are.
32
- AccessControl:
33
- Enabled: false
34
-
35
- LineLength:
36
- Max: 108
37
-
38
- Blocks:
39
- Enabled: false
40
-
41
- Documentation:
42
- Enabled: false
43
-
44
- EmptyLineBetweenDefs:
45
- Enabled: false # TODO: re-enable once SpecHelper.mock_model case is properly handled