priora 0.1.0 → 0.1.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: b201552054fb05af631621353382d07913a23fcd
4
- data.tar.gz: 50da40ed3a3c0f41984332f1d2b90422288e52ea
3
+ metadata.gz: a3d513b9621342c2d848c66bd7da0163cceb131a
4
+ data.tar.gz: 86cb36c976067628126bfb4d0a68eabbb9b1f98a
5
5
  SHA512:
6
- metadata.gz: 804d38a846743aa25d93e25bb41058882778980b8b8442d27fb851186531f2fe328c341121d30b76dc86b381d4b90dd0654543921d1c475543ec1899568ec3a9
7
- data.tar.gz: 4e61cfd500b941a3cc7988145c9f8cf6bee9dfb467309b4bc205da3475af89dbea0e6f643b3b14ffdc504131ea0addd10b069198f256cfed8e4a47ca81741c37
6
+ metadata.gz: 92f90ed65dd021e3b07aa2fdd12a07a65db03758e6760c7d2e4f43d02fc4d62f6add6b51ed5906b4dc8760ada8203484f715cf34b8c06a144ebc9805394676f4
7
+ data.tar.gz: 912afa277bc52edefe75a38e0edc89db23d7b54b8cac4b4b24f1fa3f31a58ac65c474c2610ca595f456640306f12f1449f7602e8c729c26ccf19de6b2a0d075e
@@ -0,0 +1,3 @@
1
+ plugins:
2
+ rubocop:
3
+ enabled: true
@@ -0,0 +1,8 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+
4
+ Documentation:
5
+ Enabled: false
6
+
7
+ Metrics/BlockLength:
8
+ ExcludedMethods: ['describe', 'context']
@@ -1,5 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.2.4
4
5
  - 2.4.2
6
+ - 2.5.0
5
7
  before_install: gem install bundler -v 1.16.1
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in priora.gemspec
6
6
  gemspec
@@ -1,12 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- priora (0.1.0)
4
+ priora (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ coveralls (0.8.21)
10
+ json (>= 1.8, < 3)
11
+ simplecov (~> 0.14.1)
12
+ term-ansicolor (~> 1.3)
13
+ thor (~> 0.19.4)
14
+ tins (~> 1.6)
9
15
  diff-lcs (1.2.5)
16
+ docile (1.1.5)
17
+ json (2.1.0)
10
18
  rake (10.4.2)
11
19
  rspec (3.6.0)
12
20
  rspec-core (~> 3.6.0)
@@ -21,12 +29,22 @@ GEM
21
29
  diff-lcs (>= 1.2.0, < 2.0)
22
30
  rspec-support (~> 3.6.0)
23
31
  rspec-support (3.6.0)
32
+ simplecov (0.14.1)
33
+ docile (~> 1.1.0)
34
+ json (>= 1.8, < 3)
35
+ simplecov-html (~> 0.10.0)
36
+ simplecov-html (0.10.2)
37
+ term-ansicolor (1.6.0)
38
+ tins (~> 1.0)
39
+ thor (0.19.4)
40
+ tins (1.16.3)
24
41
 
25
42
  PLATFORMS
26
43
  ruby
27
44
 
28
45
  DEPENDENCIES
29
46
  bundler (~> 1.16)
47
+ coveralls
30
48
  priora!
31
49
  rake (~> 10.0)
32
50
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Priora: An Object Prioritization Utility for Ruby
2
+ [![Gem Version](https://badge.fury.io/rb/priora.svg)](https://badge.fury.io/rb/priora)
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/7a45f13797375a92b558/maintainability)](https://codeclimate.com/github/eliav-lavi/priora/maintainability)
4
+ [![Build Status](https://travis-ci.org/eliav-lavi/priora.svg?branch=master)](https://travis-ci.org/eliav-lavi/priora)
2
5
 
3
6
  Priora supplies an easy and intuitive way to prioritize a collection of objects in Ruby.
4
7
  It serves as a useful utility for working with a collection of several instances of some data class.
@@ -166,7 +169,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
166
169
 
167
170
  ## Contributing
168
171
 
169
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/priora.
172
+ Bug reports and pull requests are welcome on GitHub at https://github.com/eliav-lavi/priora.
170
173
 
171
174
  ## License
172
175
 
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "priora"
3
+ require 'bundler/setup'
4
+ require 'priora'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "priora"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
@@ -29,7 +29,7 @@ module Priora
29
29
  else
30
30
  begin
31
31
  collection.map { |item| item.class.priorities }.uniq.first
32
- rescue StandardError => e
32
+ rescue StandardError
33
33
  raise UnsuppliedPrioritiesError
34
34
  end
35
35
  end
@@ -2,9 +2,9 @@ module Priora
2
2
  class Configuration
3
3
  def initialize
4
4
  @conversion_lambdas = {
5
- TrueClass: lambda { |_| 1 },
6
- FalseClass: lambda { |_| 0 },
7
- NilClass: lambda { |_| 0 }
5
+ TrueClass: ->(_) { 1 },
6
+ FalseClass: ->(_) { 0 },
7
+ NilClass: ->(_) { 0 }
8
8
  }
9
9
  end
10
10
 
@@ -6,7 +6,7 @@ module Priora
6
6
  DIRECTIONAL_METHODS = {
7
7
  DIRECTION_DESC => :+,
8
8
  DIRECTION_ASC => :-
9
- }
9
+ }.freeze
10
10
 
11
11
  attr_reader :attribute, :direction
12
12
 
@@ -15,7 +15,7 @@ module Priora
15
15
  else
16
16
  raise InvalidPrioritySyntaxError
17
17
  end
18
- rescue => e
18
+ rescue StandardError
19
19
  raise InvalidPrioritySyntaxError
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module Priora
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Eliav Lavi']
10
10
  spec.email = ['eliavlavi@gmail.com']
11
11
 
12
- spec.summary = %q{An object prioritization helper}
13
- spec.description = %q{Priora helps in prioritizing a collection of objects according to your needs.}
14
- spec.homepage = 'http://www.github.com/eliavlavi/priora'
12
+ spec.summary = 'An object prioritization helper'
13
+ spec.description = 'Priora helps in prioritizing a collection of objects according to your needs.'
14
+ spec.homepage = 'http://www.github.com/eliav-lavi/priora'
15
15
  spec.license = 'MIT'
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
17
  f.match(%r{^(test|spec|features)/})
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.16'
24
+ spec.add_development_dependency 'coveralls'
24
25
  spec.add_development_dependency 'rake', '~> 10.0'
25
26
  spec.add_development_dependency 'rspec', '~> 3.0'
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: priora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eliav Lavi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-11 00:00:00.000000000 Z
11
+ date: 2018-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: coveralls
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -60,8 +74,10 @@ executables: []
60
74
  extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
77
+ - ".codeclimate.yml"
63
78
  - ".gitignore"
64
79
  - ".rspec"
80
+ - ".rubocop.yml"
65
81
  - ".travis.yml"
66
82
  - Gemfile
67
83
  - Gemfile.lock
@@ -79,7 +95,7 @@ files:
79
95
  - lib/priora/priority_builder.rb
80
96
  - lib/priora/version.rb
81
97
  - priora.gemspec
82
- homepage: http://www.github.com/eliavlavi/priora
98
+ homepage: http://www.github.com/eliav-lavi/priora
83
99
  licenses:
84
100
  - MIT
85
101
  metadata: {}