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 +4 -4
- data/.rubocop.yml +2 -1
- data/.travis.yml +11 -10
- data/CHANGELOG.md +9 -0
- data/Gemfile +0 -4
- data/Guardfile +16 -0
- data/README.md +1 -1
- data/Rakefile +0 -1
- data/bin/_guard-core +29 -0
- data/bin/guard +29 -0
- data/bin/rubocop +29 -0
- data/lib/simple_navigation_bootstrap.rb +4 -7
- data/lib/simple_navigation_bootstrap/bootstrap_base.rb +1 -1
- data/lib/simple_navigation_bootstrap/error.rb +14 -0
- data/lib/simple_navigation_bootstrap/version.rb +2 -2
- data/simple_navigation_bootstrap.gemspec +5 -0
- data/spec/lib/simple_navigation_bootstrap/bootstrap3_spec.rb +1 -1
- data/spec/lib/simple_navigation_bootstrap/exceptions_spec.rb +1 -1
- metadata +51 -8
- data/.codeclimate.yml +0 -28
- data/.rspec +0 -1
- data/lib/simple_navigation_bootstrap/engine.rb +0 -6
- data/lib/simple_navigation_bootstrap/errors.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d1ab104fb57c0d331d20baeeffde7f6c2a3173fee7a9b80de6939263bcac723
|
4
|
+
data.tar.gz: a068286289a49032cad6e12f9d9bb8593bedbcfd094bac077da28f529b7552cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58030abf0ab59887c15d8ffff40842c92c3b401fd54166b427d34fa829a433fe5ac72bb42d3a24480d1dd7060dbdc50915589ff76958d9ab808333602311f03f
|
7
|
+
data.tar.gz: 6409aee9eddf1b14bfeb007b5a10efaa982a553640c42a22479a81b36355e86325f330414a14ca04c4bec7dfb0906c3e819eaae3dbeba2a7cf6ca720d26b9d14
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -2,14 +2,15 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
sudo: false
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 2.
|
5
|
+
- 2.7.1
|
6
|
+
- 2.6.6
|
7
|
+
- 2.5.8
|
8
|
+
- 2.4.10
|
9
9
|
- ruby-head
|
10
|
-
- jruby-9.2.
|
11
|
-
|
12
|
-
-
|
13
|
-
-
|
14
|
-
|
15
|
-
|
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
|
data/CHANGELOG.md
CHANGED
@@ -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
data/Guardfile
ADDED
@@ -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.
|
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
data/bin/_guard-core
ADDED
@@ -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")
|
data/bin/guard
ADDED
@@ -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")
|
data/bin/rubocop
ADDED
@@ -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
|
-
|
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 =
|
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.
|
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:
|
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/
|
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:
|
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.
|
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
|
data/.codeclimate.yml
DELETED
@@ -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,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
|