array-transitions 1.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: a53927d874a8d6558ad001a9b33fbc3c41f2872a
4
- data.tar.gz: fba4c72819a08f311bfe0f958c91ddc2de4a11c6
3
+ metadata.gz: 566d107966bbeae562d37a77ee1dfbfd28db792b
4
+ data.tar.gz: 111a9c07dc194209493a4d589ba38843f282286d
5
5
  SHA512:
6
- metadata.gz: 2fd609b1e7c7b9b81c8904c6d75363f50101cb5770fbd9fa69edfa34ca2e5b4bcdb7c4cb30d8519bfcb04a2eccdcb263e2ac1d12ab4330c672c34e9ab77d6a9d
7
- data.tar.gz: 763ad585b688c62bad75cb196f5c0f7837b9887990c8d57bf588a1355ae9602d0d69c9ed73cf2921a7458398726fba63801360e128d2eb4090df5aa9af860b8b
6
+ metadata.gz: 1e7f70049cb539590ba0929ff1a0cd617cd6a0239c5839205485f95a3595fa6796a19ed482707b2ab66519514b429ea90911d76aca19f1482743a76d1bb2bbf9
7
+ data.tar.gz: 9fe6a875fed8f3032b6db58f1c23b34b510813b179464244667b19605996b222222b5f163ab34e586e20aedf3ef6528c6325df47aedeb2bd4ba245b4efed3852
@@ -0,0 +1,11 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Exclude:
4
+ - 'array-transitions.gemspec'
5
+
6
+ Style/Documentation:
7
+ Enabled: false
8
+
9
+ Metrics/LineLength:
10
+ Exclude:
11
+ - 'spec/*_spec.rb'
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in array-transitions.gemspec
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+ require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
5
6
 
6
- task :default => :spec
7
+ task default: :spec
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "array/transitions"
4
+ require 'bundler/setup'
5
+ require 'array/transitions'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "array/transitions"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start
@@ -1,16 +1,15 @@
1
- require "array_transitions/version"
1
+ # frozen_string_literal: true
2
+ require 'array_transitions/version'
2
3
 
3
4
  class Array
4
5
  def transitions
5
- t = self.map.with_index do |e, i|
6
- next if self.size == i + 1
6
+ map.with_index do |e, i|
7
+ next if size == i + 1
7
8
 
8
9
  next_element = self[i + 1]
9
10
  next if next_element == e
10
11
 
11
12
  { from: e, to: next_element }
12
- end
13
-
14
- t.compact
13
+ end.compact
15
14
  end
16
15
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module ArrayTransitions
2
- VERSION = "1.0"
3
+ VERSION = '1.1'
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array-transitions
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Bongart
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
49
  - ".rspec"
50
+ - ".rubocop.yml"
50
51
  - CODE_OF_CONDUCT.md
51
52
  - Gemfile
52
53
  - LICENSE.txt
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  requirements: []
80
81
  rubyforge_project:
81
- rubygems_version: 2.4.5.1
82
+ rubygems_version: 2.5.1
82
83
  signing_key:
83
84
  specification_version: 4
84
85
  summary: List transitions found in an array