silueta 0.0.3 → 0.0.4

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: bf4b70b89569a496369172703eb371b7c7e00003
4
- data.tar.gz: 0b375e1a1976e7a97f24dd726d8b1207944a0518
3
+ metadata.gz: 1dcfa28a749a543fb077b2e5fd661c962a12deff
4
+ data.tar.gz: 5769a167493807fa1b21226b22e414b9dacaf2fb
5
5
  SHA512:
6
- metadata.gz: ac673c19f062c080a51fe6f3557b94af9c5fe8d273b98e436033926de7035ab071418ddee921c6bcb684aed453106462087c0f76b66ab7252684e88224df6819
7
- data.tar.gz: 31fbc471673c0501a43cb276b89cd4d5e77e511b23fd1270ce6ad7b3ffdc971eb309f919f328bbc17c124708e76ca791455d2a77ec7d57d69a9f1fc319fe0206
6
+ metadata.gz: 13c5801d21f530f3967e8ff75485d427a842a55171cdbc52a25ab26ec420ee0c976cf69d546dd66297138633b2bb90059f48eb5bad1b7b7607abd704ed8903c3
7
+ data.tar.gz: 0257d53eb4dcf46895cc32c7b695818cfce0684d02ed8a8d6674ae4b78bf21d33f545af8e79b97d5a1bc6446b2c51622fb7189e42a71f02114e54a946edb2f4e
data/.gems ADDED
@@ -0,0 +1 @@
1
+ cutest:1.2.2
data/README.md CHANGED
@@ -43,6 +43,13 @@ user.attributes
43
43
 
44
44
  See all types supported by Silueta [here][types].
45
45
 
46
+ ## Contributing
47
+
48
+ - Fork the project.
49
+ - Use `make install` to install dependencies.
50
+ - Use `make test` to run the test suite.
51
+ - Create a pull request with your changes.
52
+
46
53
  ## Installation
47
54
 
48
55
  ```
@@ -41,7 +41,7 @@ module Silueta
41
41
 
42
42
  def update(attrs)
43
43
  attrs.each do |attr, value|
44
- public_send(:"#{ attr }=", value)
44
+ public_send(:"#{ attr }=", value) if respond_to?(:"#{ attr }=")
45
45
  end
46
46
  end
47
47
 
@@ -1,3 +1,3 @@
1
1
  module Silueta
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/makefile CHANGED
@@ -1,2 +1,9 @@
1
- default:
2
- cutest test/*_test.rb
1
+ default: test
2
+
3
+ install:
4
+ @cat .gems | xargs gem install
5
+
6
+ test:
7
+ @cutest -r ./test/helper.rb ./test/*.rb
8
+
9
+ .PHONY: test
@@ -12,6 +12,5 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = `git ls-files`.split("\n")
14
14
 
15
- s.add_development_dependency "bundler", "~> 1.10"
16
15
  s.add_development_dependency "cutest", "~> 1.2"
17
16
  end
@@ -0,0 +1,2 @@
1
+ require_relative "../lib/silueta"
2
+ require_relative "../lib/silueta/types"
@@ -1,7 +1,3 @@
1
- require "bundler/setup"
2
- require "cutest"
3
- require_relative "../lib/silueta"
4
-
5
1
  class User
6
2
  include Silueta
7
3
 
@@ -42,3 +38,10 @@ test "inheritance" do
42
38
 
43
39
  assert_equal(User.attributes + [:superpowers], Admin.attributes)
44
40
  end
41
+
42
+ test "ignore unlisted attributes" do
43
+ user = User.new(name: "Jane", email: "jane@mail.com", age: "25", alignment: "chaotic neutral")
44
+
45
+ assert !user.respond_to?(:alignment)
46
+ end
47
+
@@ -1,8 +1,3 @@
1
- require "bundler/setup"
2
- require "cutest"
3
- require_relative "../lib/silueta"
4
- require_relative "../lib/silueta/types"
5
-
6
1
  class Product
7
2
  include Silueta
8
3
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silueta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayn Ektvedt Kjær
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.10'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.10'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: cutest
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -45,8 +31,7 @@ executables: []
45
31
  extensions: []
46
32
  extra_rdoc_files: []
47
33
  files:
48
- - ".gitignore"
49
- - Gemfile
34
+ - ".gems"
50
35
  - LICENSE
51
36
  - README.md
52
37
  - lib/silueta.rb
@@ -54,6 +39,7 @@ files:
54
39
  - lib/silueta/version.rb
55
40
  - makefile
56
41
  - silueta.gemspec
42
+ - test/helper.rb
57
43
  - test/silueta_test.rb
58
44
  - test/types_test.rb
59
45
  homepage: https://github.com/harmoni/silueta
@@ -76,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
62
  version: '0'
77
63
  requirements: []
78
64
  rubyforge_project:
79
- rubygems_version: 2.4.5.1
65
+ rubygems_version: 2.6.4
80
66
  signing_key:
81
67
  specification_version: 4
82
68
  summary: Initialize an object with a hash of attributes
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- /Gemfile.lock
2
- /pkg/
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec