auxiliary_rails 0.1.1 → 0.1.2

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: 4a16affdde0e48db02b404319d36263e91199b806793bd39b63130bb0c34088f
4
- data.tar.gz: 44c87100d9e2c07c41e02e8eeb56a467164dc321a41e9767a189ad99488aa71e
3
+ metadata.gz: dce34a0947ba20a256225ca03f3622701fb2a4e93ce59b9a4742398ff09e7158
4
+ data.tar.gz: 720609166305db76bbb4b501011fb240f9448894f1d0abcbd2f7cf59f6949b89
5
5
  SHA512:
6
- metadata.gz: 10c26ff79a462a5e40593ec947c415bd2351d1d1696d3e727fdd22cb67184ced9aa87a36a74e33b26811918927e9f8cdf948983ef572faa3a2166243d4f50c47
7
- data.tar.gz: a7a43960639033b86bc2f5511570cbdb28d1852b869937548558a74466dd5fbb9646697adf402acbbe32a7779523bfa2606c89ad472ea03e2fbb7b74887764f4
6
+ metadata.gz: b91070a6b45fd48d6ba572fa6994b551621bc2de2394bbb8330e6c92deee7de9a25ebbc3e07c760f4560ace4491bab91ef5ce1262d208a5419c0bb4c2e8511f5
7
+ data.tar.gz: 9e82e6f53db8770b2d0cd1771889f7a481f5e80907d0b009cbbc67878526cc4423fe242f55b986938cc73f30e2c90a5e7a4d24ed74c9ec2055aed48e651df719
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
- - 'auxiliary_rails.gemspec'
3
+ - auxiliary_rails.gemspec
4
+ - vendor/bundle/**/* # fix for running on Travis CI
4
5
 
5
6
  #################### Style ###############################
6
7
 
data/.travis.yml CHANGED
@@ -5,3 +5,6 @@ cache: bundler
5
5
  rvm:
6
6
  - 2.6.2
7
7
  before_install: gem install bundler -v 2.0.1
8
+ script:
9
+ - bundle exec rspec
10
+ - bundle exec rubocop
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
- # CHANGELOG
1
+ # AuxiliaryRails Changelog
2
2
 
3
- See https://github.com/ergoserv/auxiliary_rails/commits/master.
3
+ ## v0.1.1
4
+
5
+ * Fix Gemfile.lock
6
+
7
+ ## v0.1.1
8
+
9
+ * View Helpers: `current_controller?` and `current_action?`
10
+ * Travis CI, Code Climate integration
11
+ * Badges in README.md: gem, build status, maintainability
12
+
13
+ ## v0.1.0
14
+
15
+ Initial release
16
+
17
+ * Generators `install_rubocop` and `install_errors`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auxiliary_rails (0.1.0)
4
+ auxiliary_rails (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Collection of classes, configs, scripts, generators for Ruby on Rails helping you get things done, better.
4
4
 
5
+ [![Gem](https://img.shields.io/gem/v/auxiliary_rails.svg)](https://rubygems.org/gems/auxiliary_rails)
6
+ [![Build Status](https://travis-ci.org/ergoserv/auxiliary_rails.svg?branch=master)](https://travis-ci.org/ergoserv/auxiliary_rails)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/a317c4893a804ce577ab/maintainability)](https://codeclimate.com/github/ergoserv/auxiliary_rails/maintainability)
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -20,10 +24,18 @@ Or install it yourself as:
20
24
 
21
25
  ## Usage
22
26
 
27
+ ### Generators
28
+
23
29
  ```sh
24
- # avaliable generators
25
- rails g auxiliary_rails:install_errors
26
- rails g auxiliary_rails:install_rubocop
30
+ rails generate auxiliary_rails:install_errors
31
+ rails generate auxiliary_rails:install_rubocop
32
+ ```
33
+
34
+ ### View Helpers
35
+
36
+ ```ruby
37
+ current_controller?(*ctrl_names)
38
+ current_action?(*action_names)
27
39
  ```
28
40
 
29
41
  ## Development
@@ -0,0 +1,9 @@
1
+ require 'auxiliary_rails/view_helpers'
2
+
3
+ module AuxiliaryRails
4
+ class Railtie < Rails::Railtie
5
+ initializer 'auxiliary_rails.view_helpers' do
6
+ ActionView::Base.send :include, ViewHelpers
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module AuxiliaryRails
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
@@ -0,0 +1,11 @@
1
+ module AuxiliaryRails
2
+ module ViewHelpers
3
+ def current_controller?(*ctrl_names)
4
+ ctrl_names.include?(params[:controller])
5
+ end
6
+
7
+ def current_action?(*action_names)
8
+ action_names.include?(params[:action])
9
+ end
10
+ end
11
+ end
@@ -1,4 +1,5 @@
1
1
  require 'auxiliary_rails/abstract_error'
2
+ require 'auxiliary_rails/railtie' if defined?(Rails)
2
3
  require 'auxiliary_rails/version'
3
4
 
4
5
  module AuxiliaryRails
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxiliary_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Babenko
@@ -104,7 +104,9 @@ files:
104
104
  - bin/setup
105
105
  - lib/auxiliary_rails.rb
106
106
  - lib/auxiliary_rails/abstract_error.rb
107
+ - lib/auxiliary_rails/railtie.rb
107
108
  - lib/auxiliary_rails/version.rb
109
+ - lib/auxiliary_rails/view_helpers.rb
108
110
  - lib/generators/auxiliary_rails/install_errors_generator.rb
109
111
  - lib/generators/auxiliary_rails/install_rubocop_generator.rb
110
112
  - lib/generators/auxiliary_rails/templates/application_error_template.rb