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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ccb5b8a20cfa62e4ef74b7932724ef9c9f85629
4
- data.tar.gz: 5f7ad225cf5db86c6bb46625e2738aa8bd547cf1
3
+ metadata.gz: ac56f2a5b77e424495125e8c02d57f80ebd62321
4
+ data.tar.gz: fa414d8416214f8230f4874ce26c99f73e23ca53
5
5
  SHA512:
6
- metadata.gz: 7846d9d05da36c2436f1a5b64005544dd1080d8515b0a1814d3a395288c3b5306c383fa163de03402a06f364a98ac58418ae0a6180f3e36f1b164e6aca56ee8e
7
- data.tar.gz: eb973fec67fe6a6371c7ebd16bd67975dfab424068f87af1643b98ec8095fee98e31667b704523f4c57a2ff0b1c3be56474cd9f13ccfa016eadd2bf1870031d7
6
+ metadata.gz: 3005fa813fe2ac2a222e3a5b3bf8aac1a326fda3f220622eeaaea44b336576fbace2ee1c33d5496ab407f9a17d0808a39acd3e34630276d38ba4f39778025fb0
7
+ data.tar.gz: 4c8284663d754812c1fd0d456d8371bf7dd0a5bb5e0fe4b78553fac2633bfcd9e543249dc5fd68b9e7644a20a27988bd54db62e35e914bc5a87ce777dd678858
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
1
  --color
2
+ --format documentation
3
3
  --require spec_helper
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- guard :rspec, cmd: 'bundle exec rspec -fp' do
3
+ guard :rspec, cmd: 'bundle exec rspec --format progress' do
4
4
  watch(%r{^spec/.+_spec\.rb$})
5
5
  watch(%r{^lib/(.+)\.rb$}) { 'spec' }
6
6
  watch('spec/spec_helper.rb') { 'spec' }
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
  ```
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LazyLazer
4
4
  # The gem's semantic version number.
5
- VERSION = '0.3.1'
5
+ VERSION = '0.4.0'
6
6
  end
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] base the object to include the methods in
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[:required].include?(name) &&
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] value the new value
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.3.1
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