unit_measurements-rails 0.1.0

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: '082a82d3b8e9de8ae12596587b959b5453e901dd4451066ac564078966597dc0'
4
+ data.tar.gz: 75e711fa3ffc231a33c0b89e1890982a879c98d186c13a4fd2413ed4b144eae6
5
+ SHA512:
6
+ metadata.gz: e44a6d53d55e1a80647b90cda8ef647c9d984a8ba30af74666a39eb7c5984730815270eecdbd6c08a638b3ae32ba227a5d327d71363687abe44f28b20e0ba51b
7
+ data.tar.gz: 626f0f07b33d01d8ff8257a4902b64ea52cfff1f6a08878b8673e4e1d4baea5ad93b3c885451c41cecb9da54baea1bcdf75e439e320d7c7053e78d7e4810729e
@@ -0,0 +1,31 @@
1
+ name: Ruby
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ pull_request:
7
+ branches:
8
+ - main
9
+ jobs:
10
+ build:
11
+ name: Ruby ${{ matrix.ruby }}
12
+ runs-on: ubuntu-latest
13
+ env:
14
+ RAILS_ENV: test
15
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
16
+ strategy:
17
+ matrix:
18
+ ruby:
19
+ - "3.2.2"
20
+ steps:
21
+ - name: Checkout Repository
22
+ uses: actions/checkout@v3
23
+ - name: Set up Ruby
24
+ uses: ruby/setup-ruby@v1
25
+ with:
26
+ ruby-version: ${{ matrix.ruby }}
27
+ bundler-cache: true
28
+ - name: Run test cases
29
+ run: bundle exec rake
30
+ - name: Publish code coverage
31
+ uses: paambaati/codeclimate-action@v5.0.0
@@ -0,0 +1,31 @@
1
+ name: Publish Documentation to GitHub Pages
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ jobs:
7
+ build:
8
+ name: Publish Documentation to GitHub Pages ${{ matrix.ruby }}
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: write
12
+ strategy:
13
+ matrix:
14
+ ruby:
15
+ - "3.2.2"
16
+ steps:
17
+ - name: Checkout Repository
18
+ uses: actions/checkout@v3
19
+ - name: Set Up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ - name: Install Dependencies
24
+ run: gem install yard
25
+ - name: Generate Documentation
26
+ run: yardoc
27
+ - name: Deploy to GitHub Pages
28
+ uses: peaceiris/actions-gh-pages@v3.9.3
29
+ with:
30
+ github_token: ${{ secrets.GITHUB_TOKEN }}
31
+ publish_dir: ./doc
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --private
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.0 - 2023-11-08
2
+
3
+ ### Initial release
4
+
5
+ -----------
6
+
7
+ ### Unreleased
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ source "https://rubygems.org"
6
+
7
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ unit_measurements-rails (0.1.0)
5
+ unit_measurements (~> 5)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (7.1.1)
11
+ base64
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ mutex_m
19
+ tzinfo (~> 2.0)
20
+ base64 (0.2.0)
21
+ bigdecimal (3.1.4)
22
+ byebug (11.1.3)
23
+ concurrent-ruby (1.2.2)
24
+ connection_pool (2.4.1)
25
+ diff-lcs (1.5.0)
26
+ docile (1.4.0)
27
+ drb (2.2.0)
28
+ ruby2_keywords
29
+ i18n (1.14.1)
30
+ concurrent-ruby (~> 1.0)
31
+ minitest (5.20.0)
32
+ mutex_m (0.2.0)
33
+ rake (13.1.0)
34
+ rspec (3.12.0)
35
+ rspec-core (~> 3.12.0)
36
+ rspec-expectations (~> 3.12.0)
37
+ rspec-mocks (~> 3.12.0)
38
+ rspec-core (3.12.2)
39
+ rspec-support (~> 3.12.0)
40
+ rspec-expectations (3.12.3)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.12.0)
43
+ rspec-mocks (3.12.6)
44
+ diff-lcs (>= 1.2.0, < 2.0)
45
+ rspec-support (~> 3.12.0)
46
+ rspec-support (3.12.1)
47
+ ruby2_keywords (0.0.5)
48
+ simplecov (0.22.0)
49
+ docile (~> 1.1)
50
+ simplecov-html (~> 0.11)
51
+ simplecov_json_formatter (~> 0.1)
52
+ simplecov-html (0.12.3)
53
+ simplecov_json_formatter (0.1.4)
54
+ tzinfo (2.0.6)
55
+ concurrent-ruby (~> 1.0)
56
+ unit_measurements (5.8.0)
57
+ activesupport (~> 7.0)
58
+
59
+ PLATFORMS
60
+ x86_64-linux
61
+
62
+ DEPENDENCIES
63
+ byebug (~> 11)
64
+ rake (~> 13.0)
65
+ rspec (~> 3.0)
66
+ simplecov (~> 0.21, >= 0.21.2)
67
+ unit_measurements-rails!
68
+
69
+ BUNDLED WITH
70
+ 2.4.10
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ **Copyright (c) 2023 Harshal LADHE**
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,51 @@
1
+ # Unit Measurements Rails
2
+
3
+ A Rails adaptor that encapsulate measurements and their units in Ruby on Rails.
4
+
5
+ [![Ruby](https://github.com/shivam091/unit_measurements-rails/actions/workflows/main.yml/badge.svg)](https://github.com/shivam091/unit_measurements-rails/actions/workflows/main.yml)
6
+ [![Gem Version](https://badge.fury.io/rb/unit_measurements-rails.svg)](https://badge.fury.io/rb/unit_measurements-rails)
7
+ [![Gem Downloads](https://img.shields.io/gem/dt/unit_measurements-rails.svg)](http://rubygems.org/gems/unit_measurements-rails)
8
+ [![Maintainability](https://api.codeclimate.com/v1/badges/b319a452f37addbc077b/maintainability)](https://codeclimate.com/github/shivam091/unit_measurements-rails/maintainability)
9
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/b319a452f37addbc077b/test_coverage)](https://codeclimate.com/github/shivam091/unit_measurements-rails/test_coverage)
10
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/shivam091/unit_measurements-rails/blob/main/LICENSE.md)
11
+
12
+ [Harshal V. Ladhe, Master of Computer Science.](https://shivam091.github.io)
13
+
14
+ ## Introduction
15
+
16
+ This gem is the Rails integration for the [unit_measurements](https://github.com/shivam091/unit_measurements) gem.
17
+ It provides ActiveRecord adapter for persisting and retrieving measurements with their units.
18
+
19
+ ## Minimum Requirements
20
+
21
+ * Ruby 3.2.2+ (https://www.ruby-lang.org/en/downloads/branches/)
22
+ * Rails 7.0.0+ (https://rubygems.org/gems/rails/versions)
23
+
24
+ ## Installation
25
+
26
+ If using bundler, first add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem "unit_measurements-rails"
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ `$ bundle install`
35
+
36
+ Or otherwise simply install it yourself as:
37
+
38
+ `$ gem install unit_measurements-rails`
39
+
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am "Add some feature"`)
46
+ 4. Push to the branch (`git push origin my-new-feature`)
47
+ 5. Create new Pull Request
48
+
49
+ ## License
50
+
51
+ Copyright 2023 [Harshal V. LADHE]((https://shivam091.github.io)), Released under the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ require "bundler/gem_tasks"
6
+ require "rspec/core/rake_task"
7
+
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ task default: :spec
@@ -0,0 +1,6 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ require "unit_measurements/rails/version"
6
+ require "unit_measurements"
@@ -0,0 +1,10 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ module UnitMeasurements
6
+ module Rails
7
+ # Current stable version.
8
+ VERSION = "0.1.0"
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ module UnitMeasurements
6
+ module Rails
7
+ class BaseError < StandardError; end
8
+ end
9
+ end
10
+
11
+ require "unit_measurements/rails/base"
@@ -0,0 +1,43 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # -*- frozen_string_literal: true -*-
3
+ # -*- warn_indent: true -*-
4
+
5
+ lib = File.expand_path("../lib", __FILE__)
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+
8
+ require "unit_measurements/rails/version"
9
+
10
+ Gem::Specification.new do |spec|
11
+ spec.name = "unit_measurements-rails"
12
+ spec.version = UnitMeasurements::Rails::VERSION
13
+ spec.authors = ["Harshal LADHE"]
14
+ spec.email = ["harshal.ladhe.1@gmail.com"]
15
+
16
+ spec.description = "A Rails adaptor that encapsulate measurements and their units in Ruby on Rails."
17
+ spec.summary = "Rails adaptor for unit_measurements"
18
+ spec.homepage = "https://github.com/shivam091/unit_measurements-rails"
19
+ spec.license = "MIT"
20
+ spec.required_ruby_version = ">= 3.2.2"
21
+
22
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
23
+
24
+ spec.metadata["homepage_uri"] = spec.homepage
25
+ spec.metadata["source_code_uri"] = "https://github.com/shivam091/unit_measurements-rails"
26
+ spec.metadata["changelog_uri"] = "https://github.com/shivam091/unit_measurements-rails/blob/main/CHANGELOG.md"
27
+ spec.metadata["documentation_uri"] = "https://shivam091.github.io/unit_measurements-rails"
28
+ spec.metadata["bug_tracker_uri"] = "https://github.com/shivam091/unit_measurements-rails/issues"
29
+
30
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
31
+ f.match(%r{^(test|spec|features)/})
32
+ end
33
+ spec.bindir = "exe"
34
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
+ spec.require_paths = ["lib"]
36
+
37
+ spec.add_runtime_dependency "unit_measurements", "~> 5"
38
+
39
+ spec.add_development_dependency "rake", "~> 13.0"
40
+ spec.add_development_dependency "rspec", "~> 3.0"
41
+ spec.add_development_dependency "simplecov", "~> 0.21", ">= 0.21.2"
42
+ spec.add_development_dependency "byebug", "~> 11"
43
+ end
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unit_measurements-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Harshal LADHE
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: unit_measurements
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.21'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.21.2
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '0.21'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.21.2
75
+ - !ruby/object:Gem::Dependency
76
+ name: byebug
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '11'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '11'
89
+ description: A Rails adaptor that encapsulate measurements and their units in Ruby
90
+ on Rails.
91
+ email:
92
+ - harshal.ladhe.1@gmail.com
93
+ executables: []
94
+ extensions: []
95
+ extra_rdoc_files: []
96
+ files:
97
+ - ".github/workflows/main.yml"
98
+ - ".github/workflows/pages.yml"
99
+ - ".gitignore"
100
+ - ".rspec"
101
+ - ".yardopts"
102
+ - CHANGELOG.md
103
+ - Gemfile
104
+ - Gemfile.lock
105
+ - LICENSE.md
106
+ - README.md
107
+ - Rakefile
108
+ - lib/unit_measurements/rails.rb
109
+ - lib/unit_measurements/rails/base.rb
110
+ - lib/unit_measurements/rails/version.rb
111
+ - unit_measurements-rails.gemspec
112
+ homepage: https://github.com/shivam091/unit_measurements-rails
113
+ licenses:
114
+ - MIT
115
+ metadata:
116
+ allowed_push_host: https://rubygems.org
117
+ homepage_uri: https://github.com/shivam091/unit_measurements-rails
118
+ source_code_uri: https://github.com/shivam091/unit_measurements-rails
119
+ changelog_uri: https://github.com/shivam091/unit_measurements-rails/blob/main/CHANGELOG.md
120
+ documentation_uri: https://shivam091.github.io/unit_measurements-rails
121
+ bug_tracker_uri: https://github.com/shivam091/unit_measurements-rails/issues
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 3.2.2
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubygems_version: 3.4.10
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: Rails adaptor for unit_measurements
141
+ test_files: []