attr_required 1.0.0 → 1.0.1

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: 4260a4fdd53e85325d7f3af498b0d887abc339a9
4
- data.tar.gz: 68a371629a1048d1de4eb5cd95719d1f728d17e8
3
+ metadata.gz: dc25145c748bd59e355ea14f090b54f43506995a
4
+ data.tar.gz: 942a90f96fa116ccb9555ee6cd3525fd901b07d9
5
5
  SHA512:
6
- metadata.gz: 78fe3ea96f01939294f50b2c430346902a40e56be2603f7758ce4430b60fe4ae5cf39867e1600c7f06366655958646f8039967f0854b9761cdf8223b11b94d4c
7
- data.tar.gz: a8a9cbbac286d5ab5b38c9e89de1220c8bff2f900b2f2563524e1c986ed618236dd95ddbbf14f55453272d41ae82380b777a67cfe9d137d7cbafd597dd7539a4
6
+ metadata.gz: 60b933b1b210ad9283201c32e07cb735c747f8e11d7dd5894e1767a025af4f6784bd9b57545b7a0f46b2ec0613c79ea093b1b00734f2f6e8d27f4219b34ed4c1
7
+ data.tar.gz: 2bfd757221781bfbf398aafbd96da60f834f25f04cb313b81e7bbb8e9860db60646955be07d0700427434226f11da028e1ea8b24c1c8bdd7749f76468a82d1c3
@@ -1,3 +1,8 @@
1
+ before_install:
2
+ - gem install bundler
3
+
1
4
  rvm:
2
- - 1.9.3
3
- - 2.0.0
5
+ - 2.0
6
+ - 2.1
7
+ - 2.2
8
+ - 2.3.0
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ namespace :coverage do
8
8
  desc "Open coverage report"
9
9
  task :report do
10
10
  require 'simplecov'
11
- `open "#{File.join SimpleCov.coverage_path, 'index.html' }"`
11
+ `open "#{File.join SimpleCov.coverage_path, 'index.html'}"`
12
12
  end
13
13
  end
14
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- s.add_development_dependency "rake", ">= 0.8"
17
+ s.add_development_dependency "rake"
18
18
  s.add_development_dependency "simplecov"
19
- s.add_development_dependency "rspec", ">= 2"
19
+ s.add_development_dependency "rspec"
20
20
  end
@@ -9,16 +9,16 @@ module AttrOptional
9
9
  def inherited(klass)
10
10
  super
11
11
  unless optional_attributes.empty?
12
- klass.attr_optional *optional_attributes
12
+ klass.attr_optional(*optional_attributes)
13
13
  end
14
14
  end
15
15
 
16
16
  def attr_optional(*keys)
17
17
  if defined? undef_required_attributes
18
- undef_required_attributes *keys
18
+ undef_required_attributes(*keys)
19
19
  end
20
20
  optional_attributes.concat(keys)
21
- attr_accessor *keys
21
+ attr_accessor(*keys)
22
22
  end
23
23
 
24
24
  def attr_optional?(key)
@@ -48,4 +48,4 @@ module AttrOptional
48
48
  self.class.attr_optional? key
49
49
  end
50
50
 
51
- end
51
+ end
@@ -11,16 +11,16 @@ module AttrRequired
11
11
  def inherited(klass)
12
12
  super
13
13
  unless required_attributes.empty?
14
- klass.attr_required *required_attributes
14
+ klass.attr_required(*required_attributes)
15
15
  end
16
16
  end
17
17
 
18
18
  def attr_required(*keys)
19
19
  if defined? undef_optional_attributes
20
- undef_optional_attributes *keys
20
+ undef_optional_attributes(*keys)
21
21
  end
22
22
  required_attributes.concat keys
23
- attr_accessor *keys
23
+ attr_accessor(*keys)
24
24
  end
25
25
 
26
26
  def attr_required?(key)
@@ -71,4 +71,4 @@ module AttrRequired
71
71
  end
72
72
  end
73
73
 
74
- end
74
+ end
@@ -20,8 +20,8 @@ describe AttrOptional do
20
20
 
21
21
  context 'when already required' do
22
22
  it 'should be optional' do
23
- @c.attr_required?(:attr_required_b).should be_false
24
- @c.attr_optional?(:attr_required_b).should be_true
23
+ @c.attr_required?(:attr_required_b).should == false
24
+ @c.attr_optional?(:attr_required_b).should == true
25
25
  end
26
26
  end
27
27
 
@@ -34,19 +34,19 @@ describe AttrOptional do
34
34
 
35
35
  describe '.attr_optional?' do
36
36
  it 'should answer whether the attributes is optional or not' do
37
- A.attr_optional?(:attr_optional_a).should be_true
38
- B.attr_optional?(:attr_optional_a).should be_true
39
- B.attr_optional?(:attr_optional_b).should be_true
40
- B.attr_optional?(:to_s).should be_false
37
+ A.attr_optional?(:attr_optional_a).should == true
38
+ B.attr_optional?(:attr_optional_a).should == true
39
+ B.attr_optional?(:attr_optional_b).should == true
40
+ B.attr_optional?(:to_s).should == false
41
41
  end
42
42
  end
43
43
 
44
44
  describe '#attr_optional?' do
45
45
  it 'should answer whether the attributes is optional or not' do
46
- @a.attr_optional?(:attr_optional_a).should be_true
47
- @b.attr_optional?(:attr_optional_a).should be_true
48
- @b.attr_optional?(:attr_optional_b).should be_true
49
- @b.attr_optional?(:to_s).should be_false
46
+ @a.attr_optional?(:attr_optional_a).should == true
47
+ @b.attr_optional?(:attr_optional_a).should == true
48
+ @b.attr_optional?(:attr_optional_b).should == true
49
+ @b.attr_optional?(:to_s).should == false
50
50
  end
51
51
  end
52
52
 
@@ -20,8 +20,8 @@ describe AttrRequired do
20
20
 
21
21
  context 'when already optional' do
22
22
  it 'should be optional' do
23
- @c.attr_required?(:attr_optional_b).should be_true
24
- @c.attr_optional?(:attr_optional_b).should be_false
23
+ @c.attr_required?(:attr_optional_b).should == true
24
+ @c.attr_optional?(:attr_optional_b).should == false
25
25
  end
26
26
  end
27
27
 
@@ -34,33 +34,33 @@ describe AttrRequired do
34
34
 
35
35
  describe '.attr_required?' do
36
36
  it 'should answer whether the attributes is required or not' do
37
- A.attr_required?(:attr_required_a).should be_true
38
- B.attr_required?(:attr_required_a).should be_true
39
- B.attr_required?(:attr_required_b).should be_true
40
- B.attr_required?(:to_s).should be_false
37
+ A.attr_required?(:attr_required_a).should == true
38
+ B.attr_required?(:attr_required_a).should == true
39
+ B.attr_required?(:attr_required_b).should == true
40
+ B.attr_required?(:to_s).should == false
41
41
  end
42
42
  end
43
43
 
44
44
  describe '#attr_required?' do
45
45
  it 'should answer whether the attributes is required or not' do
46
- @a.attr_required?(:attr_required_a).should be_true
47
- @b.attr_required?(:attr_required_a).should be_true
48
- @b.attr_required?(:attr_required_b).should be_true
49
- @a.attr_required?(:attr_required_b).should be_false
50
- @b.attr_required?(:to_s).should be_false
46
+ @a.attr_required?(:attr_required_a).should == true
47
+ @b.attr_required?(:attr_required_a).should == true
48
+ @b.attr_required?(:attr_required_b).should == true
49
+ @a.attr_required?(:attr_required_b).should == false
50
+ @b.attr_required?(:to_s).should == false
51
51
  end
52
52
  end
53
53
 
54
54
  describe '#attr_missing?' do
55
55
  it 'should answer whether any attributes are missing' do
56
- @a.attr_missing?.should be_true
57
- @b.attr_missing?.should be_true
56
+ @a.attr_missing?.should == true
57
+ @b.attr_missing?.should == true
58
58
  @a.attr_required_a = 'attr_required_a'
59
59
  @b.attr_required_a = 'attr_required_a'
60
- @a.attr_missing?.should be_false
61
- @b.attr_missing?.should be_true
60
+ @a.attr_missing?.should == false
61
+ @b.attr_missing?.should == true
62
62
  @b.attr_required_b = 'attr_required_b'
63
- @b.attr_missing?.should be_false
63
+ @b.attr_missing?.should == false
64
64
  end
65
65
  end
66
66
 
@@ -4,6 +4,12 @@ SimpleCov.start do
4
4
  add_filter 'spec'
5
5
  end
6
6
 
7
+ RSpec.configure do |config|
8
+ config.expect_with :rspec do |c|
9
+ c.syntax = [:should, :expect]
10
+ end
11
+ end
12
+
7
13
  require 'attr_required'
8
14
  require 'attr_optional'
9
15
  require 'rspec'
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_required
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.8'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simplecov
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2'
54
+ version: '0'
55
55
  description: attr_required and attr_optional
56
56
  email: nov@matake.jp
57
57
  executables: []
@@ -60,9 +60,9 @@ extra_rdoc_files:
60
60
  - LICENSE
61
61
  - README.rdoc
62
62
  files:
63
- - .gitignore
64
- - .rspec
65
- - .travis.yml
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
66
  - Gemfile
67
67
  - LICENSE
68
68
  - README.rdoc
@@ -80,22 +80,22 @@ licenses:
80
80
  metadata: {}
81
81
  post_install_message:
82
82
  rdoc_options:
83
- - --charset=UTF-8
83
+ - "--charset=UTF-8"
84
84
  require_paths:
85
85
  - lib
86
86
  required_ruby_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - '>='
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: 1.3.6
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.0.3
98
+ rubygems_version: 2.5.1
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: attr_required and attr_optional