modularity 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +7 -5
- data/bin/migrate-modularity1-to-modularity2 +2 -2
- data/lib/modularity/version.rb +1 -1
- metadata +27 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5bd19df6610f9cadb9ba1bd5a88552537c32245d
|
4
|
+
data.tar.gz: cf2bf788602724e9927093685a0474b8fe3d8397
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f1d52d9653cded8e868156da655f6d020d63473d3e5b4b95dfd0071b504c1a811997077d79ca642100271885739b2ceac8be4de08a706ae87ebbc93f739cc248
|
7
|
+
data.tar.gz: 3d46ef0be45c6f6beefe09f99c17b8c0c67d82494b822c988074b025eb5b065c41f772b522db016adeca357ec3d90acd3b794faba316a4069c91e499c3561013
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Modularity 2 - Traits and partial classes for Ruby
|
2
2
|
==================================================
|
3
3
|
|
4
|
-
Modularity enhances Ruby's [`Module`] so it can be used traits and partial classes.
|
4
|
+
Modularity enhances Ruby's [`Module`](http://apidock.com/ruby/Module) so it can be used traits and partial classes.
|
5
5
|
This allows very simple definition of meta-programming macros like the
|
6
6
|
`has_many` that you know from Rails.
|
7
7
|
|
@@ -28,7 +28,7 @@ and macros.
|
|
28
28
|
Here is an example of a `strip_field` macro, which created setter methods that remove leading and trailing whitespace from newly assigned values:
|
29
29
|
|
30
30
|
# app/models/article.rb
|
31
|
-
class Article
|
31
|
+
class Article < ActiveRecord::Base
|
32
32
|
include DoesStripFields[:name, :brand]
|
33
33
|
end
|
34
34
|
|
@@ -42,7 +42,9 @@ Here is an example of a `strip_field` macro, which created setter methods that r
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
|
+
Notice the `as_trait` block.
|
47
|
+
|
46
48
|
We like to add `app/models/shared` and `app/controllers/shared` to the load paths of our Rails projects.
|
47
49
|
These are great places to store macros that are re-used from multiple classes.
|
48
50
|
|
@@ -83,8 +85,8 @@ partial classes, so each file can deal with a single aspect of your model:
|
|
83
85
|
|
84
86
|
# app/models/user.rb
|
85
87
|
class User < ActiveRecord::Base
|
86
|
-
include
|
87
|
-
include
|
88
|
+
include DoesAuthentication
|
89
|
+
include DoesPermissions
|
88
90
|
end
|
89
91
|
|
90
92
|
# app/models/user/does_authentication.rb
|
data/lib/modularity/version.rb
CHANGED
metadata
CHANGED
@@ -1,50 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modularity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Henning Koch
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
13
|
-
default_executable:
|
11
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
14
|
name: rake
|
17
|
-
requirement:
|
18
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
19
16
|
requirements:
|
20
|
-
- -
|
17
|
+
- - '>='
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: '0'
|
23
20
|
type: :development
|
24
21
|
prerelease: false
|
25
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
26
27
|
- !ruby/object:Gem::Dependency
|
27
28
|
name: rspec
|
28
|
-
requirement:
|
29
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - <
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - <
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2'
|
37
41
|
- !ruby/object:Gem::Dependency
|
38
42
|
name: rspec_candy
|
39
|
-
requirement:
|
40
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
41
44
|
requirements:
|
42
|
-
- -
|
45
|
+
- - '>='
|
43
46
|
- !ruby/object:Gem::Version
|
44
47
|
version: '0'
|
45
48
|
type: :development
|
46
49
|
prerelease: false
|
47
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
48
55
|
description: Traits and partial classes for Ruby
|
49
56
|
email: github@makandra.de
|
50
57
|
executables:
|
@@ -68,35 +75,27 @@ files:
|
|
68
75
|
- spec/rcov.opts
|
69
76
|
- spec/spec.opts
|
70
77
|
- spec/spec_helper.rb
|
71
|
-
has_rdoc: true
|
72
78
|
homepage: http://github.com/makandra/modularity
|
73
79
|
licenses: []
|
80
|
+
metadata: {}
|
74
81
|
post_install_message:
|
75
82
|
rdoc_options: []
|
76
83
|
require_paths:
|
77
84
|
- lib
|
78
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
86
|
requirements:
|
81
|
-
- -
|
87
|
+
- - '>='
|
82
88
|
- !ruby/object:Gem::Version
|
83
89
|
version: '0'
|
84
|
-
segments:
|
85
|
-
- 0
|
86
|
-
hash: 2498377129858303393
|
87
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
91
|
requirements:
|
90
|
-
- -
|
92
|
+
- - '>='
|
91
93
|
- !ruby/object:Gem::Version
|
92
94
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: 2498377129858303393
|
96
95
|
requirements: []
|
97
96
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
97
|
+
rubygems_version: 2.2.1
|
99
98
|
signing_key:
|
100
|
-
specification_version:
|
99
|
+
specification_version: 4
|
101
100
|
summary: Traits and partial classes for Ruby
|
102
101
|
test_files: []
|