guise 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -0
- data/gemfiles/3.1.gemfile.lock +10 -1
- data/gemfiles/3.2.gemfile.lock +10 -1
- data/gemfiles/4.0.gemfile.lock +10 -1
- data/guise.gemspec +1 -0
- data/lib/guise/callbacks.rb +0 -8
- data/lib/guise/syntax.rb +2 -8
- data/lib/guise/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af80e46b49952018ea9f163a53a4f81af4fdaee
|
4
|
+
data.tar.gz: c5b99965096e46d81b3b5974df37943cc0bc0ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7ddc1c311e0a5689c1512718158a57b29766aef3d8618d2e943d526ad60f1713d66ee064d8b213484f75f57abddcafe197382413c302800c6ed266cf012daa
|
7
|
+
data.tar.gz: 68dcdb32f85115adaa8ce25859c283104424f4e95e2e500e6da139c5e2c22a063a07e649a8c11d68cf124660f346304d42e7768b218da7dd5235f82fe94d5906
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -9,3 +9,5 @@ gemfile:
|
|
9
9
|
- gemfiles/4.0.gemfile
|
10
10
|
install: 'travis_retry bundle install -j 4'
|
11
11
|
script: 'bundle exec rake'
|
12
|
+
env:
|
13
|
+
secure: "I0cDQLpPt8NlOswL5Vomim4gb+NHvLW+0mPf2iimP1gTE5C+3PnoomCRx//0CyI/NSMhjrHg8DbrkvtBCfAYinrgzCi3cUkofi0zn5T6GaGUfYQz4Bmh7fmvppRVpVDCSXMOzOSYYEXBnie5b865BYTDrt1U3aM8qvq7pd/XOXg="
|
data/gemfiles/3.1.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
guise (0.4.
|
4
|
+
guise (0.4.1)
|
5
5
|
activerecord (>= 3.1, < 4.1)
|
6
6
|
activesupport (>= 3.1, < 4.1)
|
7
7
|
|
@@ -24,8 +24,11 @@ GEM
|
|
24
24
|
rake
|
25
25
|
arel (3.0.3)
|
26
26
|
builder (3.0.4)
|
27
|
+
codeclimate-test-reporter (0.3.0)
|
28
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
27
29
|
coderay (1.1.0)
|
28
30
|
diff-lcs (1.2.5)
|
31
|
+
docile (1.1.3)
|
29
32
|
factory_girl (4.4.0)
|
30
33
|
activesupport (>= 3.0.0)
|
31
34
|
i18n (0.6.9)
|
@@ -46,6 +49,11 @@ GEM
|
|
46
49
|
rspec-mocks (2.14.4)
|
47
50
|
shoulda-matchers (2.5.0)
|
48
51
|
activesupport (>= 3.0.0)
|
52
|
+
simplecov (0.8.2)
|
53
|
+
docile (~> 1.1.0)
|
54
|
+
multi_json
|
55
|
+
simplecov-html (~> 0.8.0)
|
56
|
+
simplecov-html (0.8.0)
|
49
57
|
slop (3.4.7)
|
50
58
|
sqlite3 (1.3.8)
|
51
59
|
tzinfo (0.3.38)
|
@@ -57,6 +65,7 @@ DEPENDENCIES
|
|
57
65
|
activerecord (~> 3.1)
|
58
66
|
activesupport (~> 3.1)
|
59
67
|
appraisal (~> 0.5)
|
68
|
+
codeclimate-test-reporter (~> 0.3)
|
60
69
|
factory_girl (~> 4.4)
|
61
70
|
guise!
|
62
71
|
pry (~> 0.9)
|
data/gemfiles/3.2.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
guise (0.4.
|
4
|
+
guise (0.4.1)
|
5
5
|
activerecord (>= 3.1, < 4.1)
|
6
6
|
activesupport (>= 3.1, < 4.1)
|
7
7
|
|
@@ -24,8 +24,11 @@ GEM
|
|
24
24
|
rake
|
25
25
|
arel (3.0.3)
|
26
26
|
builder (3.0.4)
|
27
|
+
codeclimate-test-reporter (0.3.0)
|
28
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
27
29
|
coderay (1.1.0)
|
28
30
|
diff-lcs (1.2.5)
|
31
|
+
docile (1.1.3)
|
29
32
|
factory_girl (4.4.0)
|
30
33
|
activesupport (>= 3.0.0)
|
31
34
|
i18n (0.6.9)
|
@@ -46,6 +49,11 @@ GEM
|
|
46
49
|
rspec-mocks (2.14.4)
|
47
50
|
shoulda-matchers (2.5.0)
|
48
51
|
activesupport (>= 3.0.0)
|
52
|
+
simplecov (0.8.2)
|
53
|
+
docile (~> 1.1.0)
|
54
|
+
multi_json
|
55
|
+
simplecov-html (~> 0.8.0)
|
56
|
+
simplecov-html (0.8.0)
|
49
57
|
slop (3.4.7)
|
50
58
|
sqlite3 (1.3.8)
|
51
59
|
tzinfo (0.3.38)
|
@@ -57,6 +65,7 @@ DEPENDENCIES
|
|
57
65
|
activerecord (~> 3.2)
|
58
66
|
activesupport (~> 3.2)
|
59
67
|
appraisal (~> 0.5)
|
68
|
+
codeclimate-test-reporter (~> 0.3)
|
60
69
|
factory_girl (~> 4.4)
|
61
70
|
guise!
|
62
71
|
pry (~> 0.9)
|
data/gemfiles/4.0.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
guise (0.4.
|
4
|
+
guise (0.4.1)
|
5
5
|
activerecord (>= 3.1, < 4.1)
|
6
6
|
activesupport (>= 3.1, < 4.1)
|
7
7
|
|
@@ -29,8 +29,11 @@ GEM
|
|
29
29
|
arel (4.0.2)
|
30
30
|
atomic (1.1.14)
|
31
31
|
builder (3.1.4)
|
32
|
+
codeclimate-test-reporter (0.3.0)
|
33
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
32
34
|
coderay (1.1.0)
|
33
35
|
diff-lcs (1.2.5)
|
36
|
+
docile (1.1.3)
|
34
37
|
factory_girl (4.4.0)
|
35
38
|
activesupport (>= 3.0.0)
|
36
39
|
i18n (0.6.9)
|
@@ -52,6 +55,11 @@ GEM
|
|
52
55
|
rspec-mocks (2.14.4)
|
53
56
|
shoulda-matchers (2.5.0)
|
54
57
|
activesupport (>= 3.0.0)
|
58
|
+
simplecov (0.8.2)
|
59
|
+
docile (~> 1.1.0)
|
60
|
+
multi_json
|
61
|
+
simplecov-html (~> 0.8.0)
|
62
|
+
simplecov-html (0.8.0)
|
55
63
|
slop (3.4.7)
|
56
64
|
sqlite3 (1.3.8)
|
57
65
|
thread_safe (0.1.3)
|
@@ -65,6 +73,7 @@ DEPENDENCIES
|
|
65
73
|
activerecord (~> 4.0)
|
66
74
|
activesupport (~> 4.0)
|
67
75
|
appraisal (~> 0.5)
|
76
|
+
codeclimate-test-reporter (~> 0.3)
|
68
77
|
factory_girl (~> 4.4)
|
69
78
|
guise!
|
70
79
|
pry (~> 0.9)
|
data/guise.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_development_dependency "shoulda-matchers", "~> 2.5"
|
30
30
|
gem.add_development_dependency "appraisal", '~> 0.5'
|
31
31
|
gem.add_development_dependency 'pry', '~> 0.9'
|
32
|
+
gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.3'
|
32
33
|
|
33
34
|
if RUBY_PLATFORM == 'java'
|
34
35
|
gem.add_development_dependency 'activerecord-jdbcsqlite3-adapter'
|
data/lib/guise/callbacks.rb
CHANGED
@@ -10,19 +10,11 @@ module Guise
|
|
10
10
|
def after_initialize(record)
|
11
11
|
record.guises.build(@attribute => @guise)
|
12
12
|
end
|
13
|
-
|
14
|
-
def after_create(record)
|
15
|
-
record.guises.create(@attribute => @guise)
|
16
|
-
end
|
17
13
|
end
|
18
14
|
|
19
15
|
class AssociationCallback < Callback
|
20
16
|
def after_initialize(record)
|
21
17
|
record.assign_attributes(@attribute => @guise)
|
22
18
|
end
|
23
|
-
|
24
|
-
def before_create(record)
|
25
|
-
record.assign_attributes(@attribute => @guise)
|
26
|
-
end
|
27
19
|
end
|
28
20
|
end
|
data/lib/guise/syntax.rb
CHANGED
@@ -51,10 +51,7 @@ module Guise
|
|
51
51
|
|
52
52
|
default_scope -> { send(model_name.plural) }
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
after_initialize callback
|
57
|
-
after_create callback
|
54
|
+
after_initialize SourceCallback.new(self.name, options[:attribute])
|
58
55
|
end
|
59
56
|
|
60
57
|
def guise_for(class_name, options = {})
|
@@ -96,10 +93,7 @@ module Guise
|
|
96
93
|
|
97
94
|
default_scope -> { where(attribute => value) }
|
98
95
|
|
99
|
-
|
100
|
-
|
101
|
-
after_initialize callback
|
102
|
-
before_create callback
|
96
|
+
after_initialize AssociationCallback.new(value, attribute)
|
103
97
|
end
|
104
98
|
end
|
105
99
|
end
|
data/lib/guise/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Gutierrez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -134,6 +134,20 @@ dependencies:
|
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0.9'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: codeclimate-test-reporter
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0.3'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0.3'
|
137
151
|
- !ruby/object:Gem::Dependency
|
138
152
|
name: sqlite3
|
139
153
|
requirement: !ruby/object:Gem::Requirement
|