rails_app_version 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -8
- data/config/app_version.yml +4 -0
- data/lib/rails_app_version/version.rb +1 -1
- data/lib/rails_app_version.rb +5 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c349aa9229b34d82b9649759bc0bf6874ac3ec0f395f1a4d7bdd82a0ecfcbcc4
|
4
|
+
data.tar.gz: fa57ffd7636b51b2dfcabda06d3d387a6e5c1d2145a024d99ba6026f36258b7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20034d4a7cd45ccf939ee1501ff6b5313e066e852565d635d2e711a22ce12ab102c3e1a538580476cb188882a916df7a014c9c329f42b94eef39bcf8a84b44cb
|
7
|
+
data.tar.gz: 5b6b218c9ddf5bf17c6a40cdf8c37eb78c84489e9ede694765083122fbe5d874b8c8d3c7e6c29a154ebb2d7df8f0b4707288b1640aecd9a3a0c79289e4772fc9
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# Rails AppVersion
|
2
2
|
|
3
|
-
|
3
|
+
Rails AppVersion is a Ruby on Rails engine designed to easily manage and access your application's version and environment information.
|
4
|
+
|
5
|
+
It allows for a seamless integration of versioning within your Rails application, providing a straightforward way to access the current application version and environment without hardcoding these values.
|
6
|
+
|
7
|
+
This gem is exclusively build for Rails applications and is compatible with Rails 7.0 and above.
|
4
8
|
|
5
9
|
## Usage
|
6
10
|
How to use my plugin.
|
@@ -30,12 +34,12 @@ Rails.application.environment # => "staging"
|
|
30
34
|
- Flexible Usage: Access the application version and environment information anywhere in your Rails application.
|
31
35
|
|
32
36
|
## Contributing
|
33
|
-
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
|
34
|
-
1.
|
35
|
-
2.
|
36
|
-
3.
|
37
|
-
4.
|
38
|
-
5.
|
37
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
|
38
|
+
1. Fork the repo
|
39
|
+
2. Create your feature branch (git checkout -b my-new-feature)
|
40
|
+
3. Commit your changes (git commit -am 'Add some feature')
|
41
|
+
4. Push to the branch (git push origin my-new-feature)
|
42
|
+
5. Create a new Pull Request
|
39
43
|
|
40
44
|
## License
|
41
45
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/rails_app_version.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rails_app_version/version"
|
4
4
|
|
5
5
|
module RailsAppVersion
|
6
6
|
class Engine < ::Rails::Engine
|
7
7
|
attr_reader :app_config, :version, :environment
|
8
8
|
|
9
|
-
initializer
|
9
|
+
initializer "fetch_config" do |app|
|
10
10
|
@app_config = begin
|
11
11
|
app.config_for(:app_version)
|
12
12
|
rescue RuntimeError
|
13
13
|
# Load the default configuration from the gem, if the app does not have one
|
14
|
-
require
|
15
|
-
yaml = Engine.root.join(
|
14
|
+
require "erb"
|
15
|
+
yaml = Engine.root.join("config", "app_version.yml")
|
16
16
|
all_configs = ActiveSupport::ConfigurationFile.parse(yaml).deep_symbolize_keys
|
17
17
|
all_configs[:shared]
|
18
18
|
end
|
@@ -20,7 +20,7 @@ module RailsAppVersion
|
|
20
20
|
@version = @app_config[:version]
|
21
21
|
@environment = @app_config[:environment] || Rails.env
|
22
22
|
end
|
23
|
-
initializer
|
23
|
+
initializer "patch_application" do |app|
|
24
24
|
# Inject the module into the application
|
25
25
|
app.class.send(:include, RailsAppVersion::AppVersion)
|
26
26
|
app.class.send(:include, RailsAppVersion::AppEnvironment)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_app_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -33,6 +33,7 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- README.md
|
35
35
|
- Rakefile
|
36
|
+
- config/app_version.yml
|
36
37
|
- lib/rails_app_version.rb
|
37
38
|
- lib/rails_app_version/version.rb
|
38
39
|
homepage: https://github.com/seuros/rails_app_version
|
@@ -50,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
51
52
|
- - ">="
|
52
53
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
54
|
+
version: 3.1.0
|
54
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
56
|
requirements:
|
56
57
|
- - ">="
|