micro_api 0.1.2 → 0.1.3

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: 931fe90b19dce2b382d2bf2a9aaa8c8387d8e473cd12ce31a9f9c7faa74cd10b
4
- data.tar.gz: '091df9223364158ce18f3adaf343e8ee42c62df40b0e2745af75e8d1e132d7be'
3
+ metadata.gz: 99a6cfc6d82c9d35036f0b7fffb1a7076ad78593e731ee1a025e68fcb60d82dd
4
+ data.tar.gz: 41a25e79645d7f6bb5b9f3135bbb0436ab96ac15f2492512d47c4b6b7ecd9aca
5
5
  SHA512:
6
- metadata.gz: c1fb1c1fa9ec7b39e6f37ce75493e0d0ebc5693d107d93cedf259771d444b0b11aca0e850eafa00ad5ae2caa72b9245d92a7314c6f95df3366009250545243b5
7
- data.tar.gz: 452621f6f949ccaa271e62952ea28708841d1e589fff4268fbd223c5fae47486eee3bf741b42db0995a67cae650522e0a04b07dc541cd57611183ea1325fa438
6
+ metadata.gz: 9d7f1a612213b649bbe000fef4878674733fa2834406d3151e64b0d8fc25d2575166832a6db26e435b6d1be1fa4ce78e23e82373e73da1d429ec28ca392dee5d
7
+ data.tar.gz: 917ab03be4c3901914ab3c1c21c339fa09eae405889891f7209fe0f70e965782f08fbfeecef2d5012baa76e8451b5153aaa3a9aff982f89afcbc2aa8f18b0995
data/README.md CHANGED
@@ -2,7 +2,16 @@
2
2
  This is a Rails plugin that would like to help the startup of rails applications oriented to microservices or, in general, application deployed on the cloud.
3
3
 
4
4
  ## Usage
5
- How to use my plugin.
5
+ How to use my plugin in a existing project
6
+ ```bash
7
+ bundle add micro_api
8
+ ```
9
+
10
+
11
+ ```bash
12
+ gem install micro_api
13
+ ```
14
+
6
15
 
7
16
  ## Installation
8
17
  Add this line to your application's Gemfile:
@@ -10,6 +19,11 @@ Add this line to your application's Gemfile:
10
19
  ```ruby
11
20
  gem "micro_api"
12
21
  ```
22
+ from localpath
23
+ ```ruby
24
+ gem 'micro_api', path: '/gems/micro_api'
25
+ ```
26
+
13
27
 
14
28
  And then execute:
15
29
  ```bash
@@ -9,6 +9,7 @@ module MicroApi
9
9
  ac: Rails.application.class.to_s.split("::").first, # app code
10
10
  cenv: ENV.fetch("CLOUD_ENV", "local"), # cloud env
11
11
  env: Rails.env, # rails env
12
+ av: app_version,
12
13
  itag: ENV.fetch("IMAGE_TAG", nil), # image tag
13
14
  }
14
15
  end
@@ -17,5 +18,13 @@ module MicroApi
17
18
  exception = ActionController::RoutingError.new("No route matches [#{request.method}] #{request.path}")
18
19
  render json: { error: exception.message }, status: :not_found
19
20
  end
21
+
22
+ private
23
+
24
+ def app_version
25
+ Rails.application.class::VERSION
26
+ rescue StandardError
27
+ nil
28
+ end
20
29
  end
21
30
  end
@@ -1,3 +1,3 @@
1
1
  module MicroApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -21,6 +21,8 @@ require "micro_api"
21
21
 
22
22
  module Dummy
23
23
  class Application < Rails::Application
24
+ VERSION = '1.2.3'.freeze
25
+
24
26
  config.load_defaults Rails::VERSION::STRING.to_f
25
27
 
26
28
  # Configuration for the application, engines, and railties goes here.
@@ -7,7 +7,8 @@ RSpec.describe "Statics" do
7
7
  it "returns http success", type: :request do
8
8
  expect(response).to have_http_status(:success)
9
9
  expect(response.header['Content-Type']).to include 'application/json'
10
- expect(json.keys).to contain_exactly('ac', 'cenv', 'env', 'itag')
10
+ expect(json.keys).to contain_exactly('ac', 'cenv', 'env', 'itag', 'av')
11
+ expect(json['av']).to eq('1.2.3'.freeze)
11
12
  end
12
13
 
13
14
  it "routes /micro_api/version to the static controller", type: :routing do
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-09 00:00:00.000000000 Z
11
+ date: 2024-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.0
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.48'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.48'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: simplecov
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.4.10
155
+ rubygems_version: 3.4.19
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Engine plugin for Ruby on Rails applications