simple_navigation_bootstrap 1.2.0 → 1.3.0

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
  SHA256:
3
- metadata.gz: 0006ec72c31300c28c3aa3c10417edb44234c99e1816ea68c4085282af648079
4
- data.tar.gz: 0a6a0f4be22120382a4f332e2b65a0ef424c37a8ed3c4b6e0feb2079848e5252
3
+ metadata.gz: 4d1ab104fb57c0d331d20baeeffde7f6c2a3173fee7a9b80de6939263bcac723
4
+ data.tar.gz: a068286289a49032cad6e12f9d9bb8593bedbcfd094bac077da28f529b7552cb
5
5
  SHA512:
6
- metadata.gz: 505f73fb61b28bb84889be932d6fcb245757618a4840ea0d3b4a169076ae529c2e8c2dce0fb67fa56ff4fed42627fb93a30b5867a1e9f831535097eb8ac86ccf
7
- data.tar.gz: 966bbd4fab96f4fb4530aad234c979e827e224feefbd477d404e1018bd5d53693cdbecf2232a6d460b46c8fe944b179523193b6f4633b1ed424c183a47342cad
6
+ metadata.gz: 58030abf0ab59887c15d8ffff40842c92c3b401fd54166b427d34fa829a433fe5ac72bb42d3a24480d1dd7060dbdc50915589ff76958d9ab808333602311f03f
7
+ data.tar.gz: 6409aee9eddf1b14bfeb007b5a10efaa982a553640c42a22479a81b36355e86325f330414a14ca04c4bec7dfb0906c3e819eaae3dbeba2a7cf6ca720d26b9d14
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
2
+ TargetRubyVersion: 2.4
3
3
  Exclude:
4
+ - bin/*
4
5
  - spec/**/*
5
6
 
6
7
  Documentation:
@@ -2,14 +2,15 @@ language: ruby
2
2
  cache: bundler
3
3
  sudo: false
4
4
  rvm:
5
- - 2.6.1
6
- - 2.5.3
7
- - 2.4.5
8
- - 2.3.8
5
+ - 2.7.1
6
+ - 2.6.6
7
+ - 2.5.8
8
+ - 2.4.10
9
9
  - ruby-head
10
- - jruby-9.2.5.0
11
- before_install:
12
- - gem update --system
13
- - gem install bundler --no-document
14
- after_success:
15
- - bundle exec codeclimate-test-reporter
10
+ - jruby-9.2.11.1
11
+ before_script:
12
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
13
+ - chmod +x ./cc-test-reporter
14
+ - ./cc-test-reporter before-build
15
+ after_script:
16
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,5 +1,14 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.3.0 - 2020-04-05
4
+
5
+ * Add support of Ruby 2.7
6
+ * Switch to Zeitwerk to load gem files
7
+ * Add binstubs to ease development
8
+ * Drop support of Ruby 2.3
9
+
10
+ * This is the last version to support Ruby 2.4.x
11
+
3
12
  ### 1.2.0 - 2019-02-09
4
13
 
5
14
  * Add Bootstrap4 renderer
data/Gemfile CHANGED
@@ -2,8 +2,4 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in simple_navigation_bootstrap.gemspec
6
5
  gemspec
7
-
8
- # CodeClimate Test Coverage
9
- gem 'codeclimate-test-reporter', group: :test, require: nil
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ guard :rspec, cmd: 'bundle exec rspec' do
4
+ require 'guard/rspec/dsl'
5
+ dsl = Guard::RSpec::Dsl.new(self)
6
+
7
+ # RSpec files
8
+ rspec = dsl.rspec
9
+ watch(rspec.spec_helper) { rspec.spec_dir }
10
+ watch(rspec.spec_support) { rspec.spec_dir }
11
+ watch(rspec.spec_files)
12
+
13
+ # Ruby files
14
+ ruby = dsl.ruby
15
+ dsl.watch_spec_files_for(ruby.lib_files)
16
+ end
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![GitHub release](https://img.shields.io/github/release/jbox-web/simple_navigation_bootstrap.svg)](https://github.com/jbox-web/simple_navigation_bootstrap/releases/latest)
5
5
  [![Gem](https://img.shields.io/gem/v/simple_navigation_bootstrap.svg)](https://rubygems.org/gems/simple_navigation_bootstrap/versions/1.0.1)
6
6
  [![Gem](https://img.shields.io/gem/dtv/simple_navigation_bootstrap.svg)](https://rubygems.org/gems/simple_navigation_bootstrap/versions/1.0.1)
7
- [![Build Status](https://travis-ci.org/jbox-web/simple_navigation_bootstrap.svg?branch=master)](https://travis-ci.org/jbox-web/simple_navigation_bootstrap)
7
+ [![Build Status](https://travis-ci.com/jbox-web/simple_navigation_bootstrap.svg?branch=master)](https://travis-ci.com/jbox-web/simple_navigation_bootstrap)
8
8
  [![Code Climate](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/badges/gpa.svg)](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap)
9
9
  [![Test Coverage](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/badges/coverage.svg)](https://codeclimate.com/github/jbox-web/simple_navigation_bootstrap/coverage)
10
10
 
data/Rakefile CHANGED
@@ -4,5 +4,4 @@ require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
-
8
7
  task default: :spec
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application '_guard-core' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("guard", "_guard-core")
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'guard' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("guard", "guard")
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rubocop", "rubocop")
@@ -3,14 +3,11 @@
3
3
  require 'forwardable'
4
4
  require 'simple-navigation'
5
5
 
6
+ require 'zeitwerk'
7
+ loader = Zeitwerk::Loader.for_gem
8
+ loader.setup
9
+
6
10
  module SimpleNavigationBootstrap
7
- require 'simple_navigation_bootstrap/errors'
8
- require 'simple_navigation_bootstrap/rendered_item'
9
- require 'simple_navigation_bootstrap/bootstrap_base'
10
- require 'simple_navigation_bootstrap/bootstrap2'
11
- require 'simple_navigation_bootstrap/bootstrap3'
12
- require 'simple_navigation_bootstrap/bootstrap4'
13
- require 'simple_navigation_bootstrap/engine' if defined? Rails::Engine
14
11
  end
15
12
 
16
13
  SimpleNavigation.register_renderer(bootstrap2: SimpleNavigationBootstrap::Bootstrap2)
@@ -75,7 +75,7 @@ module SimpleNavigationBootstrap
75
75
  icon_options = { class: name[:icon], title: name[:title] }.reject { |_, v| v.nil? }
76
76
  content_tag(:i, '', icon_options) + ' ' + (name[:text] || '')
77
77
  else
78
- name[:text] || (raise SimpleNavigationBootstrap::InvalidHash)
78
+ name[:text] || (raise SimpleNavigationBootstrap::Error::InvalidHash)
79
79
  end
80
80
  end
81
81
 
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SimpleNavigationBootstrap
4
+ module Error
5
+
6
+ # Exception raised when you set Hash without both 'text' and 'icon' parameters as Item 'name' parameter
7
+ class InvalidHash < StandardError
8
+ def initialize(msg = "Hash does not contain any of parameters: 'text', 'icon'")
9
+ super
10
+ end
11
+ end
12
+
13
+ end
14
+ end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleNavigationBootstrap
4
- # Returns the version of the currently loaded Rails as a <tt>Gem::Version</tt>
4
+
5
5
  def self.gem_version
6
6
  Gem::Version.new VERSION::STRING
7
7
  end
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 1
11
- MINOR = 2
11
+ MINOR = 3
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -13,13 +13,18 @@ Gem::Specification.new do |s|
13
13
  s.description = 'This gem adds Bootstrap2 and Bootstrap3 renderers for SimpleNavigation'
14
14
  s.license = 'MIT'
15
15
 
16
+ s.required_ruby_version = '>= 2.4.4'
17
+
16
18
  s.files = `git ls-files`.split("\n")
17
19
 
18
20
  s.add_runtime_dependency 'simple-navigation', '~> 4.0'
21
+ s.add_runtime_dependency 'zeitwerk'
19
22
 
20
23
  s.add_development_dependency 'actionpack'
21
24
  s.add_development_dependency 'actionview'
25
+ s.add_development_dependency 'guard-rspec'
22
26
  s.add_development_dependency 'rake'
23
27
  s.add_development_dependency 'rspec'
28
+ s.add_development_dependency 'rubocop'
24
29
  s.add_development_dependency 'simplecov'
25
30
  end
@@ -185,7 +185,7 @@ describe SimpleNavigationBootstrap::Bootstrap3 do
185
185
  it "raises 'InvalidHash' error" do
186
186
  expect {
187
187
  build_menu(version: 3, stub_name: true)
188
- }.to raise_error(SimpleNavigationBootstrap::InvalidHash)
188
+ }.to raise_error(SimpleNavigationBootstrap::Error::InvalidHash)
189
189
  end
190
190
  end
191
191
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe SimpleNavigationBootstrap::InvalidHash do
3
+ describe SimpleNavigationBootstrap::Error::InvalidHash do
4
4
  it 'has specific default message' do
5
5
  expect(subject.message).to eq "Hash does not contain any of parameters: 'text', 'icon'"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_navigation_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Shpak
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-09 00:00:00.000000000 Z
12
+ date: 2020-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simple-navigation
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '4.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: zeitwerk
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: actionpack
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -53,6 +67,20 @@ dependencies:
53
67
  - - ">="
54
68
  - !ruby/object:Gem::Version
55
69
  version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: guard-rspec
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
56
84
  - !ruby/object:Gem::Dependency
57
85
  name: rake
58
86
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +109,20 @@ dependencies:
81
109
  - - ">="
82
110
  - !ruby/object:Gem::Version
83
111
  version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rubocop
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
84
126
  - !ruby/object:Gem::Dependency
85
127
  name: simplecov
86
128
  requirement: !ruby/object:Gem::Requirement
@@ -103,24 +145,25 @@ executables: []
103
145
  extensions: []
104
146
  extra_rdoc_files: []
105
147
  files:
106
- - ".codeclimate.yml"
107
148
  - ".gitignore"
108
- - ".rspec"
109
149
  - ".rubocop.yml"
110
150
  - ".travis.yml"
111
151
  - AUTHORS
112
152
  - CHANGELOG.md
113
153
  - Gemfile
154
+ - Guardfile
114
155
  - LICENSE
115
156
  - README.md
116
157
  - Rakefile
158
+ - bin/_guard-core
159
+ - bin/guard
160
+ - bin/rubocop
117
161
  - lib/simple_navigation_bootstrap.rb
118
162
  - lib/simple_navigation_bootstrap/bootstrap2.rb
119
163
  - lib/simple_navigation_bootstrap/bootstrap3.rb
120
164
  - lib/simple_navigation_bootstrap/bootstrap4.rb
121
165
  - lib/simple_navigation_bootstrap/bootstrap_base.rb
122
- - lib/simple_navigation_bootstrap/engine.rb
123
- - lib/simple_navigation_bootstrap/errors.rb
166
+ - lib/simple_navigation_bootstrap/error.rb
124
167
  - lib/simple_navigation_bootstrap/rendered_item.rb
125
168
  - lib/simple_navigation_bootstrap/version.rb
126
169
  - simple_navigation_bootstrap.gemspec
@@ -146,14 +189,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
189
  requirements:
147
190
  - - ">="
148
191
  - !ruby/object:Gem::Version
149
- version: '0'
192
+ version: 2.4.4
150
193
  required_rubygems_version: !ruby/object:Gem::Requirement
151
194
  requirements:
152
195
  - - ">="
153
196
  - !ruby/object:Gem::Version
154
197
  version: '0'
155
198
  requirements: []
156
- rubygems_version: 3.0.2
199
+ rubygems_version: 3.1.2
157
200
  signing_key:
158
201
  specification_version: 4
159
202
  summary: A Ruby gem that adds Bootstrap renderers for SimpleNavigation
@@ -1,28 +0,0 @@
1
- ---
2
- engines:
3
- duplication:
4
- enabled: true
5
- config:
6
- languages:
7
- - ruby
8
- - javascript
9
- - python
10
- - php
11
- fixme:
12
- enabled: true
13
- rubocop:
14
- enabled: true
15
- exclude_fingerprints:
16
- - 55b0babc1beb44cbd9ba58882e12b227
17
- ratings:
18
- paths:
19
- - "**.inc"
20
- - "**.js"
21
- - "**.jsx"
22
- - "**.module"
23
- - "**.php"
24
- - "**.py"
25
- - "**.rb"
26
- exclude_paths:
27
- - spec/
28
- - vendor/
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SimpleNavigationBootstrap
4
- class Engine < ::Rails::Engine
5
- end
6
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SimpleNavigationBootstrap
4
- # Exception raised when you set Hash without both 'text' and 'icon' parameters as Item 'name' parameter
5
- class InvalidHash < StandardError
6
- def initialize(msg = "Hash does not contain any of parameters: 'text', 'icon'")
7
- super
8
- end
9
- end
10
- end