sequenceable 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +160 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +92 -0
- data/Rakefile +12 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/sequenceable/core.rb +22 -0
- data/lib/sequenceable/version.rb +5 -0
- data/lib/sequenceable.rb +56 -0
- data/sequenceable.gemspec +33 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '08791c3d0c74fee5f74525e8944f1f3893f3c81c04db57248863dd6523a7980f'
|
4
|
+
data.tar.gz: ac61891eda20ac7ee425ca726ee4432bca94118cf8e8b7c9f5cb205ad83fc66f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c67d80daffd99545946652a31017299b714fea7b28f69e02d7ad35be40c0e13370190b0d7d1053f586dc0181c72f2306b2f016b76a96c9b7f52f66a5ee9a9fdc
|
7
|
+
data.tar.gz: d06484a6fa6764e8e6db3654e8ff81604616d6b5463b1fb64fed36eff323d09f2bbb18364eca8a37590c52fa0e136a04fcb68dbec68757df2ccb0d8da3b4b40f
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.5
|
3
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
4
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
5
|
+
DisabledByDefault: true
|
6
|
+
Exclude:
|
7
|
+
- "**/templates/**/*"
|
8
|
+
- "**/vendor/**/*"
|
9
|
+
- "actionpack/lib/action_dispatch/journey/parser.rb"
|
10
|
+
- "db/schema.rb"
|
11
|
+
- "db/migrate/**/*"
|
12
|
+
- "node_modules/**/*"
|
13
|
+
- "bin/**"
|
14
|
+
- "config/application.rb"
|
15
|
+
- "config/boot.rb"
|
16
|
+
- "config/environment.rb"
|
17
|
+
- "config/environments/*.rb"
|
18
|
+
- "config/routes.rb"
|
19
|
+
|
20
|
+
# Prefer &&/|| over and/or.
|
21
|
+
Style/AndOr:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
# Align `when` with `case`.
|
25
|
+
Layout/CaseIndentation:
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
# Align comments with method definitions.
|
29
|
+
Layout/CommentIndentation:
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Layout/EmptyLineAfterMagicComment:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
# In a regular class definition, no empty lines around the body.
|
36
|
+
Layout/EmptyLinesAroundClassBody:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
# In a regular method definition, no empty lines around the body.
|
40
|
+
Layout/EmptyLinesAroundMethodBody:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
# In a regular module definition, no empty lines around the body.
|
44
|
+
Layout/EmptyLinesAroundModuleBody:
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
Layout/FirstArgumentIndentation:
|
48
|
+
Enabled: true
|
49
|
+
|
50
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
51
|
+
Style/HashSyntax:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
55
|
+
# extra level of indentation.
|
56
|
+
Layout/IndentationConsistency:
|
57
|
+
Enabled: true
|
58
|
+
EnforcedStyle: indented_internal_methods
|
59
|
+
|
60
|
+
# Two spaces, no tabs (for indentation).
|
61
|
+
Layout/IndentationWidth:
|
62
|
+
Enabled: true
|
63
|
+
|
64
|
+
Layout/LeadingCommentSpace:
|
65
|
+
Enabled: true
|
66
|
+
|
67
|
+
Layout/SpaceAfterColon:
|
68
|
+
Enabled: true
|
69
|
+
|
70
|
+
Layout/SpaceAfterComma:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
74
|
+
Enabled: true
|
75
|
+
|
76
|
+
Layout/SpaceAroundKeyword:
|
77
|
+
Enabled: true
|
78
|
+
|
79
|
+
Layout/SpaceAroundOperators:
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
Layout/SpaceBeforeComma:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
Layout/SpaceBeforeFirstArg:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
Style/DefWithParentheses:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
# Defining a method with parameters needs parentheses.
|
92
|
+
Style/MethodDefParentheses:
|
93
|
+
Enabled: true
|
94
|
+
|
95
|
+
Style/FrozenStringLiteralComment:
|
96
|
+
Enabled: true
|
97
|
+
EnforcedStyle: always
|
98
|
+
|
99
|
+
# Use `foo {}` not `foo{}`.
|
100
|
+
Layout/SpaceBeforeBlockBraces:
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
# Use `foo { bar }` not `foo {bar}`.
|
104
|
+
Layout/SpaceInsideBlockBraces:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
108
|
+
Layout/SpaceInsideHashLiteralBraces:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
Layout/SpaceInsideParens:
|
112
|
+
Enabled: true
|
113
|
+
|
114
|
+
# Check quotes usage according to lint rule below.
|
115
|
+
Style/StringLiterals:
|
116
|
+
Enabled: false
|
117
|
+
EnforcedStyle: double_quotes
|
118
|
+
|
119
|
+
# Detect hard tabs, no hard tabs.
|
120
|
+
Layout/Tab:
|
121
|
+
Enabled: true
|
122
|
+
|
123
|
+
# This cop looks for trailing blank lines and a final newline in the source code.
|
124
|
+
# This is being disabled because the requirement to have a final newline is illogical.
|
125
|
+
Layout/TrailingEmptyLines:
|
126
|
+
Enabled: false
|
127
|
+
|
128
|
+
# No trailing whitespace.
|
129
|
+
Layout/TrailingWhitespace:
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
# Use quotes for string literals when they are enough.
|
133
|
+
Style/RedundantPercentQ:
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
# Align `end` with the matching keyword or starting expression except for
|
137
|
+
# assignments, where it should be aligned with the LHS.
|
138
|
+
Layout/EndAlignment:
|
139
|
+
Enabled: true
|
140
|
+
EnforcedStyleAlignWith: variable
|
141
|
+
|
142
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
143
|
+
Lint/RequireParentheses:
|
144
|
+
Enabled: true
|
145
|
+
|
146
|
+
Style/RedundantReturn:
|
147
|
+
Enabled: true
|
148
|
+
AllowMultipleReturnValues: true
|
149
|
+
|
150
|
+
Style/Semicolon:
|
151
|
+
Enabled: true
|
152
|
+
AllowAsExpressionSeparator: true
|
153
|
+
|
154
|
+
# Corrects usage of :true/:false to true/false
|
155
|
+
Lint/BooleanSymbol:
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
# No space in method name and the arguments
|
159
|
+
Lint/ParenthesesAsGroupedExpression:
|
160
|
+
Enabled: true
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at sandip2490@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sequenceable (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
minitest (5.14.1)
|
10
|
+
rake (13.0.1)
|
11
|
+
|
12
|
+
PLATFORMS
|
13
|
+
ruby
|
14
|
+
|
15
|
+
DEPENDENCIES
|
16
|
+
bundler (~> 2.0)
|
17
|
+
minitest (~> 5.0)
|
18
|
+
rake (>= 12.3.3)
|
19
|
+
sequenceable!
|
20
|
+
|
21
|
+
BUNDLED WITH
|
22
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Sandip Mane
|
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,92 @@
|
|
1
|
+
# Sequenceable
|
2
|
+
|
3
|
+
Adds sequencing abilities to the ActiveRecord Models.
|
4
|
+
This gem can be useful in managing `sequence` of the records in the database.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
### Install
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'sequenceable'
|
12
|
+
```
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
bundle
|
16
|
+
```
|
17
|
+
|
18
|
+
### Create Migration
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
bin/rails generate migration AddSequenceTo{MODEL_NAME} sequence:integer
|
22
|
+
```
|
23
|
+
|
24
|
+
### Enable Sequencing
|
25
|
+
|
26
|
+
By default, `acts_in_sequence` assumes the records sequence is stored in `sequence` column of type `integer`.
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
class Task < ActiveRecord::Base
|
30
|
+
acts_in_sequence
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
#### :scope
|
35
|
+
This attribute allows us to track sequencing with a scope.
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
class TodoList < ActiveRecord::Base
|
39
|
+
has_many :tasks
|
40
|
+
end
|
41
|
+
|
42
|
+
class Task < ActiveRecord::Base
|
43
|
+
acts_in_sequence scope: :todo_list
|
44
|
+
|
45
|
+
belongs_to :todo_list
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
#### :column_name
|
50
|
+
With `:column_name` we can use custom column names instead of using `sequence`.
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
class Task < ActiveRecord::Base
|
54
|
+
acts_in_sequence column_name: :display_order
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
#### :default_order
|
59
|
+
When sequencing is applied, records will be sorted with `ASC` sequence by default. Use `default_order` attribute to change it when you need to.
|
60
|
+
Use scope `without_sequence_order` when you want to remove the default ordering.
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
class Task < ActiveRecord::Base
|
64
|
+
acts_in_sequence
|
65
|
+
end
|
66
|
+
|
67
|
+
class Item < ActiveRecord::Base
|
68
|
+
acts_in_sequence default_order: :desc
|
69
|
+
end
|
70
|
+
|
71
|
+
Task.all # => 1, 2, 3, 4, 5
|
72
|
+
Item.all # => 5, 4, 3, 2, 1
|
73
|
+
Item.without_sequence_order.all # => 1, 2, 3, 4, 5
|
74
|
+
```
|
75
|
+
|
76
|
+
## Development
|
77
|
+
|
78
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
79
|
+
|
80
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
81
|
+
|
82
|
+
## Contributing
|
83
|
+
|
84
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sandip-mane/sequenceable. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
85
|
+
|
86
|
+
## License
|
87
|
+
|
88
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
89
|
+
|
90
|
+
## Code of Conduct
|
91
|
+
|
92
|
+
Everyone interacting in the Sequenceable project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sandip-mane/sequenceable/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "sequenceable"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sequenceable
|
4
|
+
module Core
|
5
|
+
protected
|
6
|
+
def assign_sequence_before_create
|
7
|
+
self[sequencing_configuration[:column_name]] = deduce_last_sequence + 1
|
8
|
+
end
|
9
|
+
|
10
|
+
def deduce_last_sequence
|
11
|
+
build_sequencing_query.maximum(sequencing_configuration[:column_name]).to_i
|
12
|
+
end
|
13
|
+
|
14
|
+
def build_sequencing_query
|
15
|
+
for_name = sequencing_configuration[:scope]
|
16
|
+
return self.class if for_name.blank?
|
17
|
+
|
18
|
+
for_assoc = self.class.reflect_on_all_associations(:belongs_to).find { |x| x.name == for_name }
|
19
|
+
self.class.where(for_assoc.foreign_key => self[for_assoc.foreign_key])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/sequenceable.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sequenceable/version"
|
4
|
+
|
5
|
+
require "active_record"
|
6
|
+
require "sequenceable/core"
|
7
|
+
|
8
|
+
module Sequenceable
|
9
|
+
class Error < StandardError; end
|
10
|
+
|
11
|
+
def sequenceable?
|
12
|
+
included_modules.include?(Sequenceable::Core)
|
13
|
+
end
|
14
|
+
|
15
|
+
def has_valid_sequenceable_column?(column_name)
|
16
|
+
[:integer, :float, :bigint, :decimal].include? self.column_for_attribute(column_name).type
|
17
|
+
end
|
18
|
+
|
19
|
+
def acts_in_sequence(options = {})
|
20
|
+
raise ArgumentError, "acts_in_sequence => Hash expected, got #{options.class.name}" if !options.is_a?(Hash)
|
21
|
+
|
22
|
+
class_attribute :sequencing_configuration
|
23
|
+
|
24
|
+
self.sequencing_configuration = {
|
25
|
+
scope: options[:scope],
|
26
|
+
column_name: "sequence",
|
27
|
+
default_order: "ASC"
|
28
|
+
}
|
29
|
+
|
30
|
+
if options[:column_name].present?
|
31
|
+
sequencing_configuration[:column_name] = options[:column_name]
|
32
|
+
end
|
33
|
+
|
34
|
+
if !has_valid_sequenceable_column?(sequencing_configuration[:column_name])
|
35
|
+
raise ArgumentError, "acts_in_sequence => Column `#{sequencing_configuration[:column_name]}` needs to be of type `:integer`"
|
36
|
+
end
|
37
|
+
|
38
|
+
if options[:default_order].present?
|
39
|
+
sequencing_configuration[:default_order] = options[:default_order].to_s.downcase == "desc" ? "DESC" : "ASC"
|
40
|
+
end
|
41
|
+
|
42
|
+
return if sequenceable?
|
43
|
+
|
44
|
+
include Sequenceable::Core
|
45
|
+
|
46
|
+
# Scopes
|
47
|
+
default_scope { order(sequencing_configuration[:column_name] => sequencing_configuration[:default_order]) }
|
48
|
+
scope :without_sequence_order, -> { reorder("") }
|
49
|
+
|
50
|
+
# Assign sequence before create
|
51
|
+
before_create :assign_sequence_before_create
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Extend ActiveRecord's functionality
|
56
|
+
ActiveRecord::Base.extend Sequenceable
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'sequenceable/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'sequenceable'
|
9
|
+
spec.version = Sequenceable::VERSION
|
10
|
+
spec.authors = ['Sandip Mane']
|
11
|
+
spec.email = ['sandip2490@gmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'Adds sequencing abilities to the ActiveRecord Models.'
|
14
|
+
spec.description = 'A light-weight simple to use gem to manage sequencing of records in the database. Check the homepage for more information.'
|
15
|
+
spec.homepage = "https://github.com/sandip-mane/sequenceable"
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
19
|
+
spec.metadata['source_code_uri'] = "https://github.com/sandip-mane/sequenceable"
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
end
|
26
|
+
spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
32
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sequenceable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sandip Mane
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-27 00:00:00.000000000 Z
|
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: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 12.3.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 12.3.3
|
55
|
+
description: A light-weight simple to use gem to manage sequencing of records in the
|
56
|
+
database. Check the homepage for more information.
|
57
|
+
email:
|
58
|
+
- sandip2490@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rubocop.yml"
|
65
|
+
- ".travis.yml"
|
66
|
+
- CODE_OF_CONDUCT.md
|
67
|
+
- Gemfile
|
68
|
+
- Gemfile.lock
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/console
|
73
|
+
- bin/setup
|
74
|
+
- lib/sequenceable.rb
|
75
|
+
- lib/sequenceable/core.rb
|
76
|
+
- lib/sequenceable/version.rb
|
77
|
+
- sequenceable.gemspec
|
78
|
+
homepage: https://github.com/sandip-mane/sequenceable
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata:
|
82
|
+
homepage_uri: https://github.com/sandip-mane/sequenceable
|
83
|
+
source_code_uri: https://github.com/sandip-mane/sequenceable
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubygems_version: 3.0.3
|
100
|
+
signing_key:
|
101
|
+
specification_version: 4
|
102
|
+
summary: Adds sequencing abilities to the ActiveRecord Models.
|
103
|
+
test_files: []
|