lazy_lazer 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/CONTRIBUTING.md +31 -0
- data/Guardfile +1 -1
- data/README.md +1 -1
- data/lib/lazy_lazer/version.rb +1 -1
- data/lib/lazy_lazer.rb +3 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac56f2a5b77e424495125e8c02d57f80ebd62321
|
4
|
+
data.tar.gz: fa414d8416214f8230f4874ce26c99f73e23ca53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3005fa813fe2ac2a222e3a5b3bf8aac1a326fda3f220622eeaaea44b336576fbace2ee1c33d5496ab407f9a17d0808a39acd3e34630276d38ba4f39778025fb0
|
7
|
+
data.tar.gz: 4c8284663d754812c1fd0d456d8371bf7dd0a5bb5e0fe4b78553fac2633bfcd9e543249dc5fd68b9e7644a20a27988bd54db62e35e914bc5a87ce777dd678858
|
data/.rspec
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
hi there thanks for contributing to lazy_lazer
|
2
|
+
|
3
|
+
**questions**
|
4
|
+
|
5
|
+
- i like questions please ask them
|
6
|
+
|
7
|
+
**bug reports**
|
8
|
+
|
9
|
+
- i like bug reports please submit them
|
10
|
+
- put in lots of stuff about the bug ok
|
11
|
+
|
12
|
+
**pull requests**
|
13
|
+
|
14
|
+
- i like pull requests please make them
|
15
|
+
- do all your code stuff in another branch
|
16
|
+
|
17
|
+
**tests**
|
18
|
+
|
19
|
+
- lazy_lazer is maximum test-driven development
|
20
|
+
- there are ~110 lines of source code and ~230 lines of tests
|
21
|
+
- consider running `./bin/guard` during development
|
22
|
+
- run `rake` and make sure that it passes
|
23
|
+
|
24
|
+
**linting**
|
25
|
+
|
26
|
+
- make sure rubocop passes
|
27
|
+
- no worries the rubocop configuration is pretty chill
|
28
|
+
|
29
|
+
**code of conduct**
|
30
|
+
|
31
|
+
- follow [wheaton's law](https://twitter.com/wilw/status/5966220832) and you should be good
|
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,6 @@ class User
|
|
12
12
|
property :email, default: 'unknown@example.com'
|
13
13
|
property :created_at, from: 'creation_time_utc', with: ->(time) { Time.at(time) }
|
14
14
|
property :age, with: :to_i
|
15
|
-
|
16
15
|
property :favorite_ice_cream
|
17
16
|
|
18
17
|
def lazer_reload
|
@@ -28,6 +27,7 @@ user.email #=> "unknown@example.com"
|
|
28
27
|
user.created_at #=> 2017-07-14 03:40:00 +0100
|
29
28
|
user.age #=> 21
|
30
29
|
|
30
|
+
user.favorite_ice_cream #=> "chocolate"
|
31
31
|
user.favorite_ice_cream #=> "chocolate"
|
32
32
|
user.reload.favorite_ice_cream #=> "vanilla"
|
33
33
|
```
|
data/lib/lazy_lazer/version.rb
CHANGED
data/lib/lazy_lazer.rb
CHANGED
@@ -6,7 +6,7 @@ require_relative 'lazy_lazer/errors'
|
|
6
6
|
# The LazyLazer root that's included
|
7
7
|
module LazyLazer
|
8
8
|
# Hook into `include LazyLazer`.
|
9
|
-
# @param [Module]
|
9
|
+
# @param base [Module] the object to include the methods in
|
10
10
|
# @return [void]
|
11
11
|
def self.included(base)
|
12
12
|
base.extend(ClassMethods)
|
@@ -118,7 +118,7 @@ module LazyLazer
|
|
118
118
|
|
119
119
|
# Reloads if a key that should be there isn't.
|
120
120
|
reload if !@_lazer_source.key?(source_key) &&
|
121
|
-
self.class.lazer_metadata[:
|
121
|
+
self.class.lazer_metadata[:properties].include?(name) &&
|
122
122
|
!fully_loaded?
|
123
123
|
|
124
124
|
# Complains if even after reloading, the key is missing (and there's no default).
|
@@ -158,7 +158,7 @@ module LazyLazer
|
|
158
158
|
|
159
159
|
# Update an attribute.
|
160
160
|
# @param attribute [Symbol] the attribute to update
|
161
|
-
# @param [Object]
|
161
|
+
# @param value [Object] the new value
|
162
162
|
def write_attribute(attribute, value)
|
163
163
|
@_lazer_cache[attribute] = value
|
164
164
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_lazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avinash Dwarapu
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- ".gitignore"
|
119
119
|
- ".rspec"
|
120
120
|
- ".rubocop.yml"
|
121
|
+
- CONTRIBUTING.md
|
121
122
|
- Gemfile
|
122
123
|
- Guardfile
|
123
124
|
- LICENSE.txt
|