ribbonit 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a55b27e404938b7ef984d33d6954ec1c8fd3da96
4
- data.tar.gz: 93c489cfcc963a51ce748546f5b196ce5dadbbdc
3
+ metadata.gz: 59e312f51b512269d4ea31095f39b27c2d67e37a
4
+ data.tar.gz: 6e346df688f98baa773efda599fc5c46647452d3
5
5
  SHA512:
6
- metadata.gz: 96525a7a80502abd1ab189954114b340f969e2905f99edc736e0da420ff5a24d84ff0ddc66a2aa0aabd13efac81b78ac9e4427ecd97460c18e2d656db0535af6
7
- data.tar.gz: d573bb97c9d3dc597c90f369c0cf1918490621bd9966f26b8d9ecc3b9b7f06b7759d1912fa343c6eeff304fa6bff1eb6493ec6b2f5f869b3b9a600765fba2fc5
6
+ metadata.gz: 4c14899ba350feb3d23f684a3c84f34e8227f1d475ea7ad484d5d34afbf1dc24fcde2c95df3790008d87901cc4bbd13c3fd9d280de70970c2a49a5ff27878771
7
+ data.tar.gz: 6fa6226506a52ef05c0d017e994bdb9a1770f5830bd2e27de73d3c26a84431d4a1f075a5ecd56364226a97a88836f54120e84f385c343ba212eaa8368546ebcf
@@ -1,4 +1,12 @@
1
- inherit_from: https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop.yml
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-bundler.yml
3
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-layout.yml
4
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-lint.yml
5
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-naming.yml
6
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-performance.yml
7
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-style.yml
8
+ - https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-rails.yml
2
9
 
3
10
  AllCops:
11
+ DisabledByDefault: true
4
12
  TargetRubyVersion: 2.4
@@ -1,5 +1,24 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.3.0](https://github.com/anthony-robin/Ribbonit/tree/v0.3.0) (2017-11-06)
4
+ [Full Changelog](https://github.com/anthony-robin/Ribbonit/compare/v0.2.1...v0.3.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - REFACTOR way to define environments to apply [\#25](https://github.com/anthony-robin/Ribbonit/pull/25) ([anthony-robin](https://github.com/anthony-robin))
9
+ - UPDATE Rubocop sources [\#24](https://github.com/anthony-robin/Ribbonit/pull/24) ([anthony-robin](https://github.com/anthony-robin))
10
+
11
+ **Merged pull requests:**
12
+
13
+ - CLEAN documentation options [\#26](https://github.com/anthony-robin/Ribbonit/pull/26) ([anthony-robin](https://github.com/anthony-robin))
14
+
15
+ ## [v0.2.1](https://github.com/anthony-robin/Ribbonit/tree/v0.2.1) (2017-06-04)
16
+ [Full Changelog](https://github.com/anthony-robin/Ribbonit/compare/v0.2.0...v0.2.1)
17
+
18
+ **Fixed bugs:**
19
+
20
+ - FIX broken CSS [\#21](https://github.com/anthony-robin/Ribbonit/pull/21) ([anthony-robin](https://github.com/anthony-robin))
21
+
3
22
  ## [v0.2.0](https://github.com/anthony-robin/Ribbonit/tree/v0.2.0) (2017-05-28)
4
23
  [Full Changelog](https://github.com/anthony-robin/Ribbonit/compare/v0.1.0...v0.2.0)
5
24
 
data/README.md CHANGED
@@ -53,33 +53,34 @@ body
53
53
  ```
54
54
 
55
55
  ## Options
56
- You can customize some options through the initializer. Here are the defaults options:
56
+ You can customize some options through the initializer. Here are the default ones:
57
57
 
58
58
  ```ruby
59
59
  # config/initializers/ribbonit.rb
60
-
61
- # rails_version: Version of Ruby on Rails
62
- # ruby_version: Version of Ruby
63
- # git_branch: Current git branch (only displayed in development)
64
- config.infos_to_display = %i[rails_version ruby_version git_branch]
65
-
66
- config.root_link = false # Wrap ribbon with root_url link ?
67
-
68
- hide_for_small = true # Display ribbon in small devices ?
69
- position = 'top-left' # top-right, bottom-left, bottom-right
70
- sticky = true # stick to page corner ?
71
-
72
- # Available colors:
73
- # orange, blue, green, red, purple, black, white
74
- themes = {
75
- development: 'black',
76
- staging: 'blue'
77
- }
78
-
79
- # Sometimes, people use another name for this environment
80
- staging_name = 'staging'
60
+ Ribbonit.configure do |config|
61
+ # rails_version: Version of Ruby on Rails
62
+ # ruby_version: Version of Ruby
63
+ # git_branch: Current git branch (only displayed in development)
64
+ config.infos_to_display = %i[rails_version ruby_version git_branch]
65
+
66
+ config.root_link = false # Wrap ribbon with root_url link ?
67
+
68
+ config.hide_for_small = true # Display ribbon in small devices ?
69
+ config.position = 'top-left' # top-right, bottom-left, bottom-right
70
+ config.sticky = true # stick to page corner ?
71
+
72
+ # Available colors:
73
+ # orange, blue, green, red, purple, black, white
74
+ config.themes = {
75
+ development: 'black',
76
+ staging: 'blue',
77
+ my_custom_environment: 'purple'
78
+ }
79
+ end
81
80
  ```
82
81
 
82
+ To add a custom environment, just add it inside the `themes` option and set the color you want (careful, if you define `config.themes` in your initializer it will erase default environments values so you will have to readd them).
83
+
83
84
  ## Screenshots
84
85
  ### Colors
85
86
  <table>
@@ -10,7 +10,7 @@
10
10
  <% end %>
11
11
  </span>
12
12
 
13
- <% if config.infos_to_display.include?(:git_branch) && Rails.env.development? %>
13
+ <% if config.infos_to_display.include?(:git_branch) %>
14
14
  <span class="ribbon__container__git">
15
15
  Branch: <strong><%= branch_name %></strong>
16
16
  </span>
@@ -1,6 +1,6 @@
1
1
  <% config = Ribbonit.configuration %>
2
2
 
3
- <% if Rails.env.development? || Rails.env.send("#{config.staging_name}?") %>
3
+ <% if config.themes.keys.include? Rails.env.to_sym %>
4
4
 
5
5
  <div id="ribbon" class="ribbon ribbon--<%= config.position %> <%= config.hide_for_small ? 'ribbon--hide-for-small' : '' %> <%= config.sticky ? 'ribbon--sticky' : '' %> ribbon--<%= line_count %>-lines">
6
6
  <div class="ribbon__container ribbon__container--<%= config.themes[Rails.env.to_sym] %>">
@@ -42,9 +42,4 @@ Ribbonit.configure do |config|
42
42
  development: 'black',
43
43
  staging: 'blue'
44
44
  }
45
-
46
- ###
47
- # Environment name
48
- #
49
- config.staging_name = 'staging'
50
45
  end
@@ -8,23 +8,22 @@ module Ribbonit
8
8
  def self.configure
9
9
  yield configuration
10
10
  end
11
- end
12
11
 
13
- class Ribbonit::Configuration
14
- include ActiveSupport::Configurable
12
+ class Configuration
13
+ include ActiveSupport::Configurable
15
14
 
16
- config_accessor(:infos_to_display) do
17
- %i[rails_version ruby_version]
18
- end
19
- config_accessor(:root_link) { false }
20
- config_accessor(:hide_for_small) { true }
21
- config_accessor(:position) { 'top-left' }
22
- config_accessor(:sticky) { true }
23
- config_accessor(:themes) do
24
- {
25
- development: 'black',
26
- staging: 'blue'
27
- }
15
+ config_accessor(:infos_to_display) do
16
+ %i[rails_version ruby_version]
17
+ end
18
+ config_accessor(:root_link) { false }
19
+ config_accessor(:hide_for_small) { true }
20
+ config_accessor(:position) { 'top-left' }
21
+ config_accessor(:sticky) { true }
22
+ config_accessor(:themes) do
23
+ {
24
+ development: 'black',
25
+ staging: 'blue'
26
+ }
27
+ end
28
28
  end
29
- config_accessor(:staging_name) { 'staging' }
30
29
  end
@@ -4,7 +4,7 @@ require 'ribbonit/view_helpers'
4
4
  module Ribbonit
5
5
  module Rails
6
6
  class Engine < ::Rails::Engine
7
- initializer 'ribbonit.view_helpers' do |app|
7
+ initializer 'ribbonit.view_helpers' do |_app|
8
8
  ActionView::Base.send :include, ViewHelpers
9
9
  ActiveSupport.on_load(:action_controller) do
10
10
  append_view_path "#{Gem.loaded_specs['ribbonit'].full_gem_path}/lib/app/views/partials"
@@ -1,3 +1,3 @@
1
1
  module Ribbonit
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -1,17 +1,19 @@
1
- module Ribbonit::ViewHelpers
2
- def ribbonit
3
- render '/ribbon'
4
- end
1
+ module Ribbonit
2
+ module ViewHelpers
3
+ def ribbonit
4
+ render '/ribbon'
5
+ end
5
6
 
6
- def branch_name
7
- `git rev-parse --abbrev-ref HEAD`.gsub('feature/', '')
8
- end
7
+ def branch_name
8
+ `git rev-parse --abbrev-ref HEAD`.gsub('feature/', '')
9
+ end
9
10
 
10
- def line_count
11
- height = 1
12
- items = Ribbonit.configuration.infos_to_display
13
- height += 1 if items.include?(:ruby_version) || items.include?(:rails_version)
14
- height += 1 if items.include?(:git_branch) && Rails.env.development?
15
- height
11
+ def line_count
12
+ height = 1
13
+ items = Ribbonit.configuration.infos_to_display
14
+ height += 1 if items.include?(:ruby_version) || items.include?(:rails_version)
15
+ height += 1 if items.include?(:git_branch)
16
+ height
17
+ end
16
18
  end
17
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ribbonit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Robin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-04 00:00:00.000000000 Z
11
+ date: 2017-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails