scopelist 0.0.2 → 0.0.3

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: dd667ed1cda9872cea79c93f5ad694571aef5779
4
- data.tar.gz: 77c5058ee34197aa5d3b4fc8e407796d997c78cb
3
+ metadata.gz: 65a84c44246b2c3a0afd99270ca15a548b7c3f79
4
+ data.tar.gz: e73c35ca2cea404fd2ce8b51dd74564ec67751c2
5
5
  SHA512:
6
- metadata.gz: 1d523af157308e309856dd9c2f251310aeb722531589f2fdbb3e55e5ab174f5614aaac859518ce2c18504ccfc50a76f954df9176f6a2705f0bb04b08c92636de
7
- data.tar.gz: 0b028032bd988802a5b705876beb041fc520d6a4a1b57ccd2c398725668cb7dfc8341ea75b6efa471c40ab07dc73e0683eae58969c49ab1575977ecbb988a65d
6
+ metadata.gz: 2d6e54c03dd9bd85dfb6a980fbe62a8fdc9400098f2dcaeea82d46740d4d28b6e3b20783d5b415808d8e95db057f8e4847bfc6b4bfc277282798664b953a07a3
7
+ data.tar.gz: a3660ed398bf5508f037233eb0f085e31bd72a1c4cfc71d6165dc038faee967b0d1b57fe2144294a3e4b9d8088cc59f592f930fac85ff8c35590c78fd3c44d02
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.2
6
+
7
+ gemfile:
8
+ - gemfiles/4.0.gemfile
9
+ - gemfiles/4.1.gemfile
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ #### 0.0.3 (2014-07-27)
2
+ * Donot allow .available_scopes to be directly mutatable
3
+
1
4
  #### 0.0.2 (2014-07-08)
2
5
  * Fixed compatability for Ruby 2.0
3
6
 
data/README.md CHANGED
@@ -4,6 +4,8 @@ A simple way to track scopes in ActiveRecord 4.0 and 4.1.
4
4
 
5
5
  NOTE: Only Ruby 1.9.3 and later are supported
6
6
 
7
+ [![Build Status](https://travis-ci.org/t27duck/scopelist.svg?branch=master)](https://travis-ci.org/t27duck/scopelist)
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sqlite3", :platforms=>:ruby
4
+ gem "activerecord", "~> 4.0.0"
5
+ gem "activesupport", "~> 4.0.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sqlite3", :platforms=>:ruby
4
+ gem "activerecord", "~> 4.1.0"
5
+ gem "activesupport", "~> 4.1.0"
6
+
7
+ gemspec :path=>"../"
data/lib/scopelist.rb CHANGED
@@ -13,17 +13,20 @@ module Scopelist
13
13
 
14
14
  module ClassMethods
15
15
  def scope_with_scopelist(name, body, &block)
16
- available_scopes << name.to_sym
16
+ additional_available_scope name
17
17
  scope_without_scopelist(name, body, &block)
18
18
  end
19
19
 
20
20
  def available_scopes
21
21
  @available_scopes ||= []
22
+ @available_scopes.dup
22
23
  end
23
24
 
24
25
  def additional_available_scope(name)
25
- available_scopes << name.to_sym
26
+ @available_scopes ||= []
27
+ @available_scopes << name.to_sym
26
28
  end
29
+
27
30
  end
28
31
  end
29
32
 
@@ -1,3 +1,3 @@
1
1
  module Scopelist
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -12,6 +12,12 @@ describe '.available_scopes' do
12
12
  it 'does not bleed into other models' do
13
13
  expect(SomeOtherThing.available_scopes).to eq([])
14
14
  end
15
+
16
+ it 'cannot be mutated' do
17
+ expected = SomeThing.available_scopes.dup
18
+ SomeThing.available_scopes << :scope2
19
+ expect(SomeThing.available_scopes).to eq(expected)
20
+ end
15
21
  end
16
22
 
17
23
  describe '.additonal_available_scope' do
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopelist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Drake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-08 00:00:00.000000000 Z
11
+ date: 2014-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 4.0.0
34
34
  type: :runtime
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: 4.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
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
54
  version: '1.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: sqlite3
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Adds ability to track scopes on ActiveRecord models
@@ -101,12 +101,15 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
104
+ - ".gitignore"
105
+ - ".travis.yml"
105
106
  - CHANGELOG.md
106
107
  - Gemfile
107
108
  - LICENSE.txt
108
109
  - README.md
109
110
  - Rakefile
111
+ - gemfiles/4.0.gemfile
112
+ - gemfiles/4.1.gemfile
110
113
  - lib/scopelist.rb
111
114
  - lib/scopelist/version.rb
112
115
  - scopelist.gemspec
@@ -124,17 +127,17 @@ require_paths:
124
127
  - lib
125
128
  required_ruby_version: !ruby/object:Gem::Requirement
126
129
  requirements:
127
- - - '>='
130
+ - - ">="
128
131
  - !ruby/object:Gem::Version
129
132
  version: '0'
130
133
  required_rubygems_version: !ruby/object:Gem::Requirement
131
134
  requirements:
132
- - - '>='
135
+ - - ">="
133
136
  - !ruby/object:Gem::Version
134
137
  version: '0'
135
138
  requirements: []
136
139
  rubyforge_project:
137
- rubygems_version: 2.0.2
140
+ rubygems_version: 2.2.0
138
141
  signing_key:
139
142
  specification_version: 4
140
143
  summary: Adds ability to track scopes on ActiveRecord models