fudo3 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +101 -0
- data/.github/dependabot.yml +8 -0
- data/.rubocop.yml +18 -0
- data/.travis.yml +1 -1
- data/Gemfile +3 -4
- data/Gemfile.lock +55 -15
- data/README.md +9 -1
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/fudo3.gemspec +20 -9
- data/lib/fudo3.rb +6 -4
- data/lib/fudo3/version.rb +3 -1
- metadata +120 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bfc739686e09e7b34afd301d3e7c6e4795866d8a6da51e714cd1610e617d674
|
4
|
+
data.tar.gz: 3b7c61d737ebe4ffcf75628262083ef0d8526baed5636ea22bc7e7dc4460cb7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d2c2c9180cb86d24cea50645d86915554025a8b6d5673a1fd72055b5e2fd4d51a7ec0361b44343e15ac524b6c6a1c0f3be85c5670c8ffad92fec5c999257d1e
|
7
|
+
data.tar.gz: f517fd58c179edf335dd1362daa1c7fc5b314bb6db4ef653e46f2c1dacbf7d0e7d4ff07735f75f0a9c06ae0c929e3ad58db517dd22612a85a073acaae183eeb4
|
@@ -0,0 +1,101 @@
|
|
1
|
+
version: 2
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
parallelism: 3
|
5
|
+
docker:
|
6
|
+
- image: circleci/ruby:2.6.7
|
7
|
+
environment:
|
8
|
+
BUNDLE_JOBS: 3
|
9
|
+
BUNDLE_RETRY: 3
|
10
|
+
BUNDLE_PATH: vendor/bundle
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- checkout
|
14
|
+
|
15
|
+
- run:
|
16
|
+
name: install Bundler
|
17
|
+
command: |
|
18
|
+
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
|
19
|
+
source $BASH_ENV
|
20
|
+
gem install bundler
|
21
|
+
|
22
|
+
- run:
|
23
|
+
name: Which bundler?
|
24
|
+
command: bundle -v
|
25
|
+
|
26
|
+
- restore_cache:
|
27
|
+
keys:
|
28
|
+
- gem-sample-{{ checksum "Gemfile.lock" }}
|
29
|
+
- gem-sample-
|
30
|
+
|
31
|
+
- run:
|
32
|
+
name: Bundle Install
|
33
|
+
command: bundle check --path vendor/bundle || bundle install --deployment
|
34
|
+
|
35
|
+
- save_cache:
|
36
|
+
key: gem-sample-{{ checksum "Gemfile.lock" }}
|
37
|
+
paths:
|
38
|
+
- vendor/bundle
|
39
|
+
|
40
|
+
- run:
|
41
|
+
name: run rubocop
|
42
|
+
command: |
|
43
|
+
bundle exec rubocop
|
44
|
+
- run:
|
45
|
+
name: Run rspec in parallel
|
46
|
+
command: |
|
47
|
+
bundle exec rspec --profile 10 \
|
48
|
+
--format RspecJunitFormatter \
|
49
|
+
--out test_results/rspec.xml \
|
50
|
+
--format progress \
|
51
|
+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
52
|
+
- store_test_results:
|
53
|
+
path: test_results
|
54
|
+
- store_artifacts:
|
55
|
+
path: test_results
|
56
|
+
destination: test-results
|
57
|
+
- store_artifacts:
|
58
|
+
path: coverage
|
59
|
+
destination: coverage-results
|
60
|
+
deploy:
|
61
|
+
docker:
|
62
|
+
- image: circleci/ruby:2.6.7
|
63
|
+
|
64
|
+
steps:
|
65
|
+
- checkout
|
66
|
+
|
67
|
+
- run:
|
68
|
+
name: install Bundler
|
69
|
+
command: |
|
70
|
+
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
|
71
|
+
source $BASH_ENV
|
72
|
+
gem install bundler
|
73
|
+
- run:
|
74
|
+
name: Which bundler?
|
75
|
+
command: bundle -v
|
76
|
+
|
77
|
+
- restore_cache:
|
78
|
+
keys:
|
79
|
+
- gem-deploy-{{ checksum "Gemfile.lock" }}
|
80
|
+
- gem-deploy-
|
81
|
+
|
82
|
+
- run:
|
83
|
+
name: Bundle Install
|
84
|
+
command: bundle check --path vendor/bundle || bundle install
|
85
|
+
|
86
|
+
- save_cache:
|
87
|
+
key: gem-deploy-{{ checksum "Gemfile.lock" }}
|
88
|
+
paths:
|
89
|
+
- vendor/bundle
|
90
|
+
|
91
|
+
workflows:
|
92
|
+
version: 2
|
93
|
+
build-and-deploy:
|
94
|
+
jobs:
|
95
|
+
- build
|
96
|
+
- deploy:
|
97
|
+
requires:
|
98
|
+
- build
|
99
|
+
filters:
|
100
|
+
branches:
|
101
|
+
only: master
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require: rubocop-rake
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.6.7
|
5
|
+
|
6
|
+
Style/AsciiComments:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
Style/Documentation:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
Naming/MethodParameterName:
|
13
|
+
MinNameLength: 2
|
14
|
+
|
15
|
+
Metrics/BlockLength:
|
16
|
+
Exclude:
|
17
|
+
- 'fudo3.gemspec'
|
18
|
+
- 'spec/**/*'
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,34 +1,74 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fudo3 (0.1.
|
4
|
+
fudo3 (0.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
ast (2.4.2)
|
9
10
|
diff-lcs (1.4.4)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
docile (1.3.5)
|
12
|
+
parallel (1.20.1)
|
13
|
+
parser (3.0.1.1)
|
14
|
+
ast (~> 2.4.1)
|
15
|
+
rainbow (3.0.0)
|
16
|
+
rake (13.0.3)
|
17
|
+
regexp_parser (2.1.1)
|
18
|
+
rexml (3.2.5)
|
19
|
+
rspec (3.10.0)
|
20
|
+
rspec-core (~> 3.10.0)
|
21
|
+
rspec-expectations (~> 3.10.0)
|
22
|
+
rspec-mocks (~> 3.10.0)
|
23
|
+
rspec-core (3.10.0)
|
24
|
+
rspec-support (~> 3.10.0)
|
25
|
+
rspec-expectations (3.10.0)
|
18
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.
|
20
|
-
rspec-mocks (3.
|
27
|
+
rspec-support (~> 3.10.0)
|
28
|
+
rspec-mocks (3.10.0)
|
21
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.
|
23
|
-
rspec-support (3.
|
30
|
+
rspec-support (~> 3.10.0)
|
31
|
+
rspec-support (3.10.0)
|
32
|
+
rspec_junit_formatter (0.4.1)
|
33
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
34
|
+
rubocop (1.14.0)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 3.0.0.0)
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
38
|
+
regexp_parser (>= 1.8, < 3.0)
|
39
|
+
rexml
|
40
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
41
|
+
ruby-progressbar (~> 1.7)
|
42
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
43
|
+
rubocop-ast (1.5.0)
|
44
|
+
parser (>= 3.0.1.1)
|
45
|
+
rubocop-rake (0.5.1)
|
46
|
+
rubocop
|
47
|
+
rubocop-rspec (2.3.0)
|
48
|
+
rubocop (~> 1.0)
|
49
|
+
rubocop-ast (>= 1.1.0)
|
50
|
+
ruby-progressbar (1.11.0)
|
51
|
+
simplecov (0.21.2)
|
52
|
+
docile (~> 1.1)
|
53
|
+
simplecov-html (~> 0.11)
|
54
|
+
simplecov_json_formatter (~> 0.1)
|
55
|
+
simplecov-html (0.12.3)
|
56
|
+
simplecov_json_formatter (0.1.3)
|
57
|
+
unicode-display_width (2.0.0)
|
24
58
|
|
25
59
|
PLATFORMS
|
26
60
|
ruby
|
27
61
|
|
28
62
|
DEPENDENCIES
|
63
|
+
bundler (~> 2.1)
|
29
64
|
fudo3!
|
30
|
-
rake (
|
31
|
-
rspec
|
65
|
+
rake (>= 13.0.3)
|
66
|
+
rspec
|
67
|
+
rspec_junit_formatter
|
68
|
+
rubocop
|
69
|
+
rubocop-rake
|
70
|
+
rubocop-rspec
|
71
|
+
simplecov
|
32
72
|
|
33
73
|
BUNDLED WITH
|
34
74
|
2.1.4
|
data/README.md
CHANGED
@@ -48,8 +48,16 @@ Fudo3.jo_to_tsubo(1)
|
|
48
48
|
=> 0.5010005187875194
|
49
49
|
|
50
50
|
# 平米
|
51
|
-
Fudo3.
|
51
|
+
Fudo3.to_heibei(1, 1)
|
52
52
|
=> 1
|
53
|
+
|
54
|
+
# 坪単価
|
55
|
+
Fudo3.price_per_tsubo(10000, 1000)
|
56
|
+
=> 10.0
|
57
|
+
|
58
|
+
# 平米単価
|
59
|
+
Fudo3.price_per_heibei(10000, 1000)
|
60
|
+
=> 10.0
|
53
61
|
```
|
54
62
|
|
55
63
|
## Contributing
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'fudo3'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "fudo3"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/fudo3.gemspec
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/fudo3/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name =
|
6
|
+
spec.name = 'fudo3'
|
5
7
|
spec.version = Fudo3::VERSION
|
6
|
-
spec.authors = [
|
7
|
-
spec.email = [
|
8
|
+
spec.authors = ['Shuhei Yamashita']
|
9
|
+
spec.email = ['y.shuhei0501@gmail.com']
|
8
10
|
|
9
11
|
spec.summary = '不動産で使用する関数'
|
10
12
|
spec.description = '不動産で使用する関数をまとめたgemです。'
|
11
13
|
spec.homepage = 'https://github.com/yposi/fudo3'
|
12
|
-
spec.license =
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new(
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6')
|
14
16
|
|
15
17
|
if spec.respond_to?(:metadata)
|
16
|
-
spec.metadata[
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
19
|
spec.metadata['source_code_uri'] = 'https://github.com/yposi/fudo3'
|
18
20
|
spec.metadata['changelog_uri'] = 'https://github.com/yposi/fudo3'
|
19
21
|
else
|
@@ -23,10 +25,19 @@ Gem::Specification.new do |spec|
|
|
23
25
|
|
24
26
|
# Specify which files should be added to the gem when it is released.
|
25
27
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
-
spec.files
|
28
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
27
29
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
30
|
end
|
29
|
-
spec.bindir =
|
31
|
+
spec.bindir = 'exe'
|
30
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = [
|
33
|
+
spec.require_paths = ['lib']
|
34
|
+
|
35
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
36
|
+
spec.add_development_dependency 'rake', '>= 13.0.3'
|
37
|
+
spec.add_development_dependency 'rspec'
|
38
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
39
|
+
spec.add_development_dependency 'rubocop'
|
40
|
+
spec.add_development_dependency 'rubocop-rake'
|
41
|
+
spec.add_development_dependency 'rubocop-rspec'
|
42
|
+
spec.add_development_dependency 'simplecov'
|
32
43
|
end
|
data/lib/fudo3.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fudo3/version'
|
2
4
|
|
3
5
|
module Fudo3
|
4
6
|
class Error < StandardError; end
|
@@ -52,7 +54,7 @@ module Fudo3
|
|
52
54
|
# @param [Float] length 縦
|
53
55
|
# # @param [Float] width 横
|
54
56
|
# @return [Float] 平米
|
55
|
-
def self.
|
57
|
+
def self.to_heibei(length, width)
|
56
58
|
length.to_f * width.to_f
|
57
59
|
end
|
58
60
|
|
@@ -61,7 +63,7 @@ module Fudo3
|
|
61
63
|
# @param [Float] tsubo 坪
|
62
64
|
# @return [Float] 坪単価
|
63
65
|
def self.price_per_tsubo(price, tsubo)
|
64
|
-
price.to_f / tsubo
|
66
|
+
price.to_f / tsubo
|
65
67
|
end
|
66
68
|
|
67
69
|
# 平米単価
|
@@ -69,6 +71,6 @@ module Fudo3
|
|
69
71
|
# @param [Float] heibei 平米
|
70
72
|
# @return [Float] 平米単価
|
71
73
|
def self.price_per_heibei(price, heibei)
|
72
|
-
price.to_f / heibei
|
74
|
+
price.to_f / heibei
|
73
75
|
end
|
74
76
|
end
|
data/lib/fudo3/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fudo3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuhei Yamashita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2021-05-06 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.1'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
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.3
|
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.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
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: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
13
125
|
description: 不動産で使用する関数をまとめたgemです。
|
14
126
|
email:
|
15
127
|
- y.shuhei0501@gmail.com
|
@@ -17,9 +129,12 @@ executables: []
|
|
17
129
|
extensions: []
|
18
130
|
extra_rdoc_files: []
|
19
131
|
files:
|
132
|
+
- ".circleci/config.yml"
|
133
|
+
- ".github/dependabot.yml"
|
20
134
|
- ".gitignore"
|
21
135
|
- ".rakeTasks"
|
22
136
|
- ".rspec"
|
137
|
+
- ".rubocop.yml"
|
23
138
|
- ".travis.yml"
|
24
139
|
- CODE_OF_CONDUCT.md
|
25
140
|
- Gemfile
|
@@ -47,14 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
162
|
requirements:
|
48
163
|
- - ">="
|
49
164
|
- !ruby/object:Gem::Version
|
50
|
-
version: 2.
|
165
|
+
version: '2.6'
|
51
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
167
|
requirements:
|
53
168
|
- - ">="
|
54
169
|
- !ruby/object:Gem::Version
|
55
170
|
version: '0'
|
56
171
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.2.17
|
58
173
|
signing_key:
|
59
174
|
specification_version: 4
|
60
175
|
summary: 不動産で使用する関数
|