dynamic_footer 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fccdba22bf469859650b61467c7c09f0d34a0a86afb3380f9bf841ea1a0e1366
4
+ data.tar.gz: b7390ec7a092f47033d6319663aa6d435f7e2af97c1222d7f91587dad8658936
5
+ SHA512:
6
+ metadata.gz: 9eaf2b4b225b616ade8ef336522bcca60b84614508738133a340891ec5a8d661da9aa586a41474d68832a39b24c36c64ba2c156390e591181fec78bf16a92fc7
7
+ data.tar.gz: 5a3374586b21c40ca339359d96d5a2a60c199f76e5771ff7871c07df43caa3ff4a77cff0fcd2913b6bff78c033765eb25b16b74d9c7a490cd5a78065f30f118e
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/BLUEPRINT.md ADDED
@@ -0,0 +1,2 @@
1
+ The following are the steps to build this gem from scratch.
2
+ ```bundle gem dynamic_footer && cd dynamic_footer && subl .```
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-07-13
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ellyambet10@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Elly Ambet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # DynamicFooter
2
+
3
+ This lightweight gem allows you to effortlessly add the current year to your footer. Though that can just be handled by ```Time.now.year``` it's always cool to be able to do something extra effortlessly and that's where this gem comes in. It empowers you to customize your app name, or fallback to the default Rails app name, and easily include copyright information and "All Rights Reserved" statements.It may be a small gem, but it's designed to bring simplicity and convenience to your footer. This gem has been inspired by the fact that the JS way of adding the current year to footer is buggy in the rails environment.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'dynamic_footer'
11
+
12
+ And then execute:
13
+
14
+ $ bundle install
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install dynamic_footer
19
+
20
+ ## Usage
21
+
22
+ To use this gem, simply add the following to your footer:
23
+
24
+ <%= footer_statement('My Company INC.') %>
25
+
26
+ This will produce the following output:
27
+
28
+ © 2023 My Company INC. - All Rights Reserved.
29
+
30
+
31
+ If you want to use the default Rails app name, simply omit the argument:
32
+
33
+ <%= footer_statement %>
34
+
35
+ This will produce the following output:
36
+
37
+ © 2023 My App - All Rights Reserved.
38
+
39
+ You can also add a custom statement to the footer by using the following:
40
+
41
+ <%= footer_statement('My Company INC.', 'This is a custom statement.') %>
42
+
43
+ This will produce the following output:
44
+
45
+ © 2023 My Company INC. - All Rights Reserved. This is a custom statement.
46
+
47
+ You can also add each part individually as follows:(This results in more lines of code and doesn't support the idea of simplicity that this gem intends to solve. But you can use it if you want to highly customize the footer statement)
48
+
49
+ ```
50
+ <%= footer_info[:copyright] %> or <%= footer_info("Your Copyright Custom Statement")[:copyright] %>
51
+ <%= footer_info[:year] %>
52
+ <%= footer_info[:name] %> or <%= footer_info("Your Custom Name")[:name] %>
53
+ <%= footer_info[:separator] %> or <%= footer_info("Your Custom Separator")[:separator] %>
54
+ <%= footer_info[:rights] %> or <%= footer_info("Your Custom Rights")[:rights] %>
55
+ ```
56
+
57
+ ## Contributing
58
+
59
+ Bug reports and pull requests are welcome on GitHub at https://github.com/elibiz443/dynamic_footer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/elibiz443/dynamic_footer/blob/main/CODE_OF_CONDUCT.md).
60
+
61
+ ## License
62
+
63
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
64
+
65
+ ## Code of Conduct
66
+
67
+ Everyone interacting in the DynamicFooter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/dynamic_footer/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/dynamic_footer/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "dynamic_footer"
7
+ spec.version = DynamicFooter::VERSION
8
+ spec.authors = ["Elly Ambet"]
9
+ spec.email = ["ellyambet10@gmail.com"]
10
+
11
+ spec.summary = "gem that allows you to add dynamic footer info to your rails app."
12
+ spec.description = "This lightweight gem allows you to effortlessly add the current year to your footer. Though that can just be handled by --Time.now.year-- it's always cool to be able to do something extra effortlessly and that's where this gem comes in. It empowers you to customize your app name, or fallback to the default Rails app name, and easily include copyright information and 'All Rights Reserved' statements.It may be a small gem, but it's designed to bring simplicity and convenience to your footer. This gem has been inspired by the fact that the JS way of adding the current year to footer is buggy in the rails environment."
13
+ spec.homepage = "https://github.com/elibiz443/dynamic_footer"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/elibiz443/dynamic_footer"
21
+ spec.metadata["changelog_uri"] = "https://github.com/elibiz443/dynamic_footer/blob/master/CHANGELOG.md"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) ||
28
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
29
+ end
30
+ end
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ["lib"]
34
+
35
+ spec.add_development_dependency "bundler", "~> 2.4.14"
36
+ spec.add_development_dependency "rails", "~> 7.0.6"
37
+ spec.add_development_dependency 'actionview'
38
+
39
+ spec.add_dependency "rails", "~> 7.0.6"
40
+ end
@@ -0,0 +1,21 @@
1
+ module DynamicFooter
2
+ module FooterInfo
3
+ def self.info(footer_element = {})
4
+ {
5
+ copyright: footer_element[:copyright] || '©',
6
+ year: Time.now.year,
7
+ name: footer_element[:name] || Rails.application.class.module_parent_name,
8
+ separator: footer_element[:separator] || ' - ',
9
+ rights: footer_element[:rights] || 'All Rights Reserved'
10
+ }
11
+ end
12
+
13
+ def self.format_footer(footer_statement = {})
14
+ "#{footer_statement[:copyright]}
15
+ #{footer_statement[:year]}
16
+ #{footer_statement[:name]}
17
+ #{footer_statement[:separator]}
18
+ #{footer_statement[:rights]}"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ module DynamicFooter
2
+ module Helpers
3
+ module ApplicationHelper
4
+ def footer_info(footer_element = {})
5
+ DynamicFooter::FooterInfo.info(footer_element)
6
+ end
7
+
8
+ def footer_statement(name = nil, footer_element = {})
9
+ footer_info = footer_info(footer_element)
10
+ footer_info[:name] = name || footer_info[:name]
11
+ DynamicFooter::FooterInfo.format_footer(footer_info)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DynamicFooter
4
+ VERSION = "0.1.1"
5
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dynamic_footer/version'
4
+ require 'dynamic_footer/footer_info'
5
+ require 'dynamic_footer/helpers/application_helper'
6
+ require 'action_view'
7
+ require 'rails'
8
+
9
+ module DynamicFooter
10
+ class Error < StandardError; end
11
+ end
12
+
13
+ ActionView::Base.include DynamicFooter::Helpers::ApplicationHelper
@@ -0,0 +1,4 @@
1
+ module DynamicFooter
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dynamic_footer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Elly Ambet
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.4.14
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.4.14
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 7.0.6
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 7.0.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: actionview
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 7.0.6
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 7.0.6
69
+ description: This lightweight gem allows you to effortlessly add the current year
70
+ to your footer. Though that can just be handled by --Time.now.year-- it's always
71
+ cool to be able to do something extra effortlessly and that's where this gem comes
72
+ in. It empowers you to customize your app name, or fallback to the default Rails
73
+ app name, and easily include copyright information and 'All Rights Reserved' statements.It
74
+ may be a small gem, but it's designed to bring simplicity and convenience to your
75
+ footer. This gem has been inspired by the fact that the JS way of adding the current
76
+ year to footer is buggy in the rails environment.
77
+ email:
78
+ - ellyambet10@gmail.com
79
+ executables: []
80
+ extensions: []
81
+ extra_rdoc_files: []
82
+ files:
83
+ - ".rspec"
84
+ - BLUEPRINT.md
85
+ - CHANGELOG.md
86
+ - CODE_OF_CONDUCT.md
87
+ - LICENSE.txt
88
+ - README.md
89
+ - Rakefile
90
+ - dynamic_footer.gemspec
91
+ - lib/dynamic_footer.rb
92
+ - lib/dynamic_footer/footer_info.rb
93
+ - lib/dynamic_footer/helpers/application_helper.rb
94
+ - lib/dynamic_footer/version.rb
95
+ - sig/dynamic_footer.rbs
96
+ homepage: https://github.com/elibiz443/dynamic_footer
97
+ licenses:
98
+ - MIT
99
+ metadata:
100
+ allowed_push_host: https://rubygems.org
101
+ homepage_uri: https://github.com/elibiz443/dynamic_footer
102
+ source_code_uri: https://github.com/elibiz443/dynamic_footer
103
+ changelog_uri: https://github.com/elibiz443/dynamic_footer/blob/master/CHANGELOG.md
104
+ post_install_message:
105
+ rdoc_options: []
106
+ require_paths:
107
+ - lib
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 2.6.0
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ requirements: []
119
+ rubygems_version: 3.4.14
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: gem that allows you to add dynamic footer info to your rails app.
123
+ test_files: []