acts_as_toggleable 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rubocop.yml +45 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/Guardfile +17 -0
- data/LICENSE +21 -0
- data/README.md +113 -0
- data/Rakefile +10 -0
- data/acts_as_toggleable.gemspec +34 -0
- data/lib/acts_as_toggleable.rb +17 -0
- data/lib/acts_as_toggleable/active_record/acts/toggleable.rb +56 -0
- data/lib/acts_as_toggleable/version.rb +3 -0
- data/test/permalink/active_record_test.rb +51 -0
- data/test/support/article.rb +3 -0
- data/test/support/schema.rb +10 -0
- data/test/support/story.rb +4 -0
- data/test/test_helper.rb +15 -0
- metadata +193 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 95218fee4742311ff12d26e4a6f6f5a97c47abca
|
4
|
+
data.tar.gz: 49cd4e68d367a500cef51cf57783529ec39e7df1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1438a570886c4a296f7834494e26067f064fd13e82c4f445f2922dae69b3930853d63dae8a45b15c185f8992e653ddb5cc8fef9bb2ca9f0d8b0bd0273af8fcd6
|
7
|
+
data.tar.gz: c0766f55b348ec89e8a3c8e8a6677be24590b1d483afb775a8215ffb662a51f488dcda688262df6cff1fe047dda9d15b3afa86730bc16143211f74727af60a23
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
|
4
|
+
LineLength:
|
5
|
+
Max: 175
|
6
|
+
|
7
|
+
ClassLength:
|
8
|
+
CountComments: false # count full line comments?
|
9
|
+
Max: 175
|
10
|
+
|
11
|
+
MethodLength:
|
12
|
+
CountComments: false # count full line comments?
|
13
|
+
Max: 20
|
14
|
+
|
15
|
+
HashSyntax:
|
16
|
+
EnforcedStyle: hash_rockets
|
17
|
+
|
18
|
+
Documentation:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
CollectionMethods:
|
22
|
+
PreferredMethods:
|
23
|
+
map: 'collect'
|
24
|
+
map!: 'collect!'
|
25
|
+
reduce: 'inject'
|
26
|
+
find: 'detect'
|
27
|
+
find_all: 'select'
|
28
|
+
|
29
|
+
Output:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
HasAndBelongsToMany:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Style/ClassAndModuleChildren:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Style/RegexpLiteral:
|
39
|
+
EnforcedStyle: percent_r
|
40
|
+
|
41
|
+
Style/SpaceInsideStringInterpolation:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Metrics/AbcSize:
|
45
|
+
Max: 17
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.1
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
guard :rubocop do
|
2
|
+
watch(%r{.+\.gemspec$})
|
3
|
+
watch(%r{.+\.rb$})
|
4
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
5
|
+
end
|
6
|
+
|
7
|
+
guard :minitest do
|
8
|
+
# with Minitest::Unit
|
9
|
+
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
|
10
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
11
|
+
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
12
|
+
|
13
|
+
# with Minitest::Spec
|
14
|
+
# watch(%r{^spec/(.*)_spec\.rb$})
|
15
|
+
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
16
|
+
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
17
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 PJ Kelly (Crush & Lovely)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# Acts As Toggleable
|
2
|
+
|
3
|
+
[![RubyGem Version](http://img.shields.io/gem/v/acts_as_toggleable.svg?style=flat)](https://rubygems.org/gems/acts_as_toggleable)
|
4
|
+
[![Dependency Status](http://img.shields.io/gemnasium/crushlovely/acts_as_toggleable.svg?style=flat)](https://gemnasium.com/crushlovely/acts_as_toggleable)
|
5
|
+
[![Build Status](http://img.shields.io/travis/crushlovely/acts_as_toggleable.svg?style=flat)](https://travis-ci.org/crushlovely/acts_as_toggleable)
|
6
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/crushlovely/acts_as_toggleable.svg?style=flat)](https://codeclimate.com/github/crushlovely/acts_as_toggleable)
|
7
|
+
[![Code Coverage](http://img.shields.io/codeclimate/coverage/github/crushlovely/acts_as_toggleable.svg?style=flat)](https://codeclimate.com/github/crushlovely/acts_as_toggleable)
|
8
|
+
|
9
|
+
Create toggleable attributes for your ActiveRecord models.
|
10
|
+
|
11
|
+
## Why?
|
12
|
+
|
13
|
+
We frequently require the ability to toggle the visibility of content on an application's front-end.
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
`gem install acts_as_toggleable`
|
18
|
+
|
19
|
+
or in your `Gemfile`
|
20
|
+
|
21
|
+
``` ruby
|
22
|
+
gem 'acts_as_toggleable'
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Make sure you require the library.
|
28
|
+
|
29
|
+
``` ruby
|
30
|
+
require 'acts_as_toggleable'
|
31
|
+
```
|
32
|
+
|
33
|
+
This gem follows a similar API to many ActiveRecord plugins:
|
34
|
+
|
35
|
+
``` ruby
|
36
|
+
class Widget < ActiveRecord::Base
|
37
|
+
acts_as_toggleable :visible
|
38
|
+
# acts_as_toggleable :visible, :default => false
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
This sets up a boolean field on the model, and also makes the following instance methods available:
|
43
|
+
|
44
|
+
``` ruby
|
45
|
+
widget = Widget.new
|
46
|
+
widget.visible
|
47
|
+
# => true
|
48
|
+
|
49
|
+
# toggle the widget's visibility, but don't persist the change
|
50
|
+
widget.toggle(:visible)
|
51
|
+
widget.visible
|
52
|
+
# => false
|
53
|
+
|
54
|
+
# toggle the widget's visibility and persist the change
|
55
|
+
widget.toggle!(:visible)
|
56
|
+
```
|
57
|
+
|
58
|
+
### Options
|
59
|
+
|
60
|
+
In addition to the name of the attribute to create, you can also pass the following options:
|
61
|
+
|
62
|
+
* `:scope_name`: The Symbol representing the name of the positive scope (optional, default: toggleable_attribute).
|
63
|
+
* `:inverse_scope_name`: The Symbol representing the name of the negative scope (optional, default: "not_#{toggleable_attribute}").
|
64
|
+
|
65
|
+
### Scopes
|
66
|
+
|
67
|
+
Two scopes are automatically created when you define a toggleable attribute:
|
68
|
+
|
69
|
+
``` ruby
|
70
|
+
class Widget < ActiveRecord::Base
|
71
|
+
acts_as_toggleable :visible
|
72
|
+
end
|
73
|
+
|
74
|
+
widget1 = Widget.create(:visible => true)
|
75
|
+
widget2 = Widget.create(:visible => false)
|
76
|
+
|
77
|
+
Widget.visible
|
78
|
+
# => [widget1]
|
79
|
+
|
80
|
+
Widget.not_visible
|
81
|
+
# => [widget2]
|
82
|
+
```
|
83
|
+
|
84
|
+
These are just plain old ActiveRecord scopes, so you can chain them together with other scopes as needed:
|
85
|
+
|
86
|
+
``` ruby
|
87
|
+
Widget.visible.where(:created_at.lte => 10.days.ago)
|
88
|
+
```
|
89
|
+
|
90
|
+
You can also customize the names of the scope created:
|
91
|
+
|
92
|
+
``` ruby
|
93
|
+
class Widget < ActiveRecord::Base
|
94
|
+
acts_as_toggleable :published, :inverse_scope_name => :unpublished
|
95
|
+
end
|
96
|
+
|
97
|
+
Widget.published
|
98
|
+
Widget.unpublished
|
99
|
+
```
|
100
|
+
|
101
|
+
## Contributing to acts_as_toggleable
|
102
|
+
|
103
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
104
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
105
|
+
* Fork the project
|
106
|
+
* Start a feature/bugfix branch
|
107
|
+
* Commit and push until you are happy with your contribution
|
108
|
+
* Make sure to add tests for it. This is important so we don't break it in a future version unintentionally.
|
109
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so we can cherry-pick around it.
|
110
|
+
|
111
|
+
## Copyright
|
112
|
+
|
113
|
+
Copyright (c) 2016 PJ Kelly (Crush & Lovely). See LICENSE for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require 'acts_as_toggleable/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'acts_as_toggleable'
|
9
|
+
spec.version = ActsAsToggleable::VERSION
|
10
|
+
spec.authors = ['PJ Kelly']
|
11
|
+
spec.email = ['pj@crushlovely.com']
|
12
|
+
spec.homepage = 'https://github.com/crushlovely/acts_as_toggleable'
|
13
|
+
spec.summary = 'Toggleable attributes for your ActiveRecord models.'
|
14
|
+
spec.description = 'Toggleable attributes for your ActiveRecord models.'
|
15
|
+
|
16
|
+
spec.rubyforge_project = 'acts_as_toggleable'
|
17
|
+
|
18
|
+
spec.files = `git ls-files`.split("\n")
|
19
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_runtime_dependency('activerecord', '>= 4.2.0.beta4')
|
24
|
+
|
25
|
+
spec.add_dependency('activesupport', '>= 4.2.0.beta4')
|
26
|
+
|
27
|
+
spec.add_development_dependency 'sqlite3'
|
28
|
+
spec.add_development_dependency 'minitest-utils'
|
29
|
+
spec.add_development_dependency 'rake'
|
30
|
+
spec.add_development_dependency('rubocop')
|
31
|
+
spec.add_development_dependency('guard-rubocop')
|
32
|
+
spec.add_development_dependency('guard-minitest')
|
33
|
+
spec.add_development_dependency('codeclimate-test-reporter')
|
34
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'active_support/core_ext/array/extract_options'
|
3
|
+
require 'acts_as_toggleable/active_record/acts/toggleable'
|
4
|
+
|
5
|
+
module ActsAsToggleable
|
6
|
+
if defined?(Rails::Railtie)
|
7
|
+
class Railtie < Rails::Railtie
|
8
|
+
initializer 'acts_as_toggleable.insert_into_active_record' do
|
9
|
+
ActiveSupport.on_load :active_record do
|
10
|
+
ActiveRecord::Base.send(:include, ActiveRecord::Acts::Toggleable)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
elsif defined?(ActiveRecord)
|
15
|
+
ActiveRecord::Base.send(:include, ActiveRecord::Acts::Toggleable)
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module Acts
|
3
|
+
module Toggleable
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
extend ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
# Public: Create a toggleable attribute on the model.
|
12
|
+
#
|
13
|
+
# toggleable_attribute - A symbol representing the name of the attribute to be created.
|
14
|
+
# options - The Hash options used to customize the attribute (default: {}):
|
15
|
+
# :scope_name - The Symbol representing the name of the positive scope
|
16
|
+
# (optional, default: #{toggleable_attribute}).
|
17
|
+
# :inverse_scope_name - The Symbol representing the name of the negative scope
|
18
|
+
# (optional, default: #{toggleable_attribute}).
|
19
|
+
#
|
20
|
+
# Examples:
|
21
|
+
#
|
22
|
+
# acts_as_toggleable :for_sale, :default => false
|
23
|
+
# acts_as_toggleable :visible, :inverse_scope_name => :hidden
|
24
|
+
# acts_as_toggleable :publishable, :default => false, :inverse_scope_name => :unpublishable
|
25
|
+
# acts_as_toggleable :featured, :default => true, :scope_name => :features
|
26
|
+
#
|
27
|
+
# Defines the attribute specified as well as relevant scopes.
|
28
|
+
def acts_as_toggleable(toggleable_attribute, options = {})
|
29
|
+
defaults = {
|
30
|
+
:scope_name => toggleable_attribute,
|
31
|
+
:inverse_scope_name => "not_#{toggleable_attribute}"
|
32
|
+
}
|
33
|
+
options = defaults.merge(options)
|
34
|
+
|
35
|
+
scope options[:scope_name], -> { where(toggleable_attribute => true) }
|
36
|
+
scope options[:inverse_scope_name], -> { where(toggleable_attribute => false) }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Public: Toggle the attribute specified
|
41
|
+
#
|
42
|
+
# Returns the value the attribute was changed to. Does not persist the change.
|
43
|
+
def toggle(toggleable_attribute)
|
44
|
+
send("#{toggleable_attribute}=", !send(toggleable_attribute))
|
45
|
+
end
|
46
|
+
|
47
|
+
# Public: Toggle the attribute specified and persist the change
|
48
|
+
#
|
49
|
+
# Returns the result of #save.
|
50
|
+
def toggle!(toggleable_attribute)
|
51
|
+
toggle(toggleable_attribute)
|
52
|
+
save
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ActiveRecordTest < Minitest::Test
|
4
|
+
setup do
|
5
|
+
Article.delete_all
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:visible_article) { Article.create(:visible => true) }
|
9
|
+
let(:hidden_article) { Article.create(:visible => false) }
|
10
|
+
|
11
|
+
test 'scopes creation based on the parameters passed in' do
|
12
|
+
assert_respond_to Article, :visible
|
13
|
+
assert_respond_to Article, :hidden
|
14
|
+
assert_respond_to Story, :publishable
|
15
|
+
assert_respond_to Story, :unpublishable
|
16
|
+
assert_respond_to Story, :features
|
17
|
+
assert_respond_to Story, :not_featured
|
18
|
+
end
|
19
|
+
|
20
|
+
test 'positive scope returns the appropriate records' do
|
21
|
+
assert_includes Article.visible, visible_article
|
22
|
+
refute_includes Article.visible, hidden_article
|
23
|
+
end
|
24
|
+
|
25
|
+
test 'negative scope returns the appropriate records' do
|
26
|
+
assert_includes Article.hidden, hidden_article
|
27
|
+
refute_includes Article.hidden, visible_article
|
28
|
+
end
|
29
|
+
|
30
|
+
test '#toggle toggles the value of the toggleable field' do
|
31
|
+
assert_equal visible_article.visible, true
|
32
|
+
visible_article.toggle(:visible)
|
33
|
+
assert_equal visible_article.visible, false
|
34
|
+
|
35
|
+
assert_equal hidden_article.visible, false
|
36
|
+
hidden_article.toggle(:visible)
|
37
|
+
assert_equal hidden_article.visible, true
|
38
|
+
end
|
39
|
+
|
40
|
+
test '#toggle! toggles the value of the toggleable field' do
|
41
|
+
assert_equal visible_article.visible, true
|
42
|
+
visible_article.toggle!(:visible)
|
43
|
+
visible_article.reload
|
44
|
+
assert_equal visible_article.visible, false
|
45
|
+
|
46
|
+
assert_equal hidden_article.visible, false
|
47
|
+
hidden_article.toggle!(:visible)
|
48
|
+
hidden_article.reload
|
49
|
+
assert_equal hidden_article.visible, true
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ActiveRecord::Schema.define(:version => 0) do
|
2
|
+
create_table :stories do |t|
|
3
|
+
t.boolean :publishable, :null => false, :default => false
|
4
|
+
t.boolean :featured, :null => false, :default => false
|
5
|
+
end
|
6
|
+
|
7
|
+
create_table :articles do |t|
|
8
|
+
t.boolean :visible, :null => false, :default => false
|
9
|
+
end
|
10
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
|
3
|
+
require 'codeclimate-test-reporter'
|
4
|
+
CodeClimate::TestReporter.start
|
5
|
+
|
6
|
+
require 'acts_as_toggleable'
|
7
|
+
|
8
|
+
require 'minitest/utils'
|
9
|
+
require 'minitest/autorun'
|
10
|
+
|
11
|
+
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
|
12
|
+
|
13
|
+
load('support/schema.rb')
|
14
|
+
require 'support/article'
|
15
|
+
require 'support/story'
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_toggleable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- PJ Kelly
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0.beta4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0.beta4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.2.0.beta4
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.2.0.beta4
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest-utils
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-minitest
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: codeclimate-test-reporter
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: Toggleable attributes for your ActiveRecord models.
|
140
|
+
email:
|
141
|
+
- pj@crushlovely.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".rubocop.yml"
|
148
|
+
- ".ruby-version"
|
149
|
+
- ".travis.yml"
|
150
|
+
- CHANGELOG.md
|
151
|
+
- Gemfile
|
152
|
+
- Guardfile
|
153
|
+
- LICENSE
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- acts_as_toggleable.gemspec
|
157
|
+
- lib/acts_as_toggleable.rb
|
158
|
+
- lib/acts_as_toggleable/active_record/acts/toggleable.rb
|
159
|
+
- lib/acts_as_toggleable/version.rb
|
160
|
+
- test/permalink/active_record_test.rb
|
161
|
+
- test/support/article.rb
|
162
|
+
- test/support/schema.rb
|
163
|
+
- test/support/story.rb
|
164
|
+
- test/test_helper.rb
|
165
|
+
homepage: https://github.com/crushlovely/acts_as_toggleable
|
166
|
+
licenses: []
|
167
|
+
metadata: {}
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
requirements: []
|
183
|
+
rubyforge_project: acts_as_toggleable
|
184
|
+
rubygems_version: 2.5.1
|
185
|
+
signing_key:
|
186
|
+
specification_version: 4
|
187
|
+
summary: Toggleable attributes for your ActiveRecord models.
|
188
|
+
test_files:
|
189
|
+
- test/permalink/active_record_test.rb
|
190
|
+
- test/support/article.rb
|
191
|
+
- test/support/schema.rb
|
192
|
+
- test/support/story.rb
|
193
|
+
- test/test_helper.rb
|