shioconv 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.coveralls.yml +2 -0
- data/.gitignore +1 -1
- data/.travis.yml +4 -0
- data/Gemfile +2 -2
- data/README.md +7 -9
- data/Rakefile +3 -1
- data/config/condiments.yaml +6 -0
- data/lib/shioconv/unit.rb +3 -3
- data/lib/shioconv/version.rb +1 -1
- data/shioconv.gemspec +2 -1
- data/spec/shioconv/condiment_spec.rb +7 -0
- data/spec/shioconv/unit_spec.rb +6 -2
- data/spec/shioconv_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -0
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3296e6bcb23533da813a6b21eae5308f858cf6f1
|
4
|
+
data.tar.gz: e31fe0cbc866f9b9f96b0c2f39b15c973971860f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75339d09eef387eed0b70e7f8cba3ea447f0ae765ec2ac64e62dd6cc6f25de2ea2962e4dc1506320ddf28f8af32a2a7e02632a0e3bba2d8ececb76e2f90f93d4
|
7
|
+
data.tar.gz: 9163594a1a542d3967d6c15b7108db2c8ae33bdb012bdf653d002ed0bfb9e53a74fb0a1ca0bbca4ed80a36571095cf180024c9e676ac4a074d1b68035325c14c
|
data/.coveralls.yml
ADDED
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Shioconv
|
2
2
|
|
3
|
-
convert between
|
3
|
+
convert between volumes and weight for typcal condiments.
|
4
|
+
|
5
|
+
[](https://travis-ci.org/kwappa/shioconv)
|
6
|
+
|
7
|
+
[](https://coveralls.io/r/kwappa/shioconv?branch=master)
|
8
|
+
|
9
|
+
[](https://codeclimate.com/github/kwappa/shioconv)
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -33,11 +39,3 @@ salt.to_g # => 18.0
|
|
33
39
|
Shioconv::Condiment.list # => returns array of string
|
34
40
|
Shioconv::Unit.list # => returns array of string
|
35
41
|
```
|
36
|
-
|
37
|
-
## Contributing
|
38
|
-
|
39
|
-
1. Fork it ( https://github.com/kwappa/shioconv/fork )
|
40
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
41
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
42
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
43
|
-
5. Create a new Pull Request
|
data/Rakefile
CHANGED
data/config/condiments.yaml
CHANGED
@@ -108,6 +108,7 @@
|
|
108
108
|
:synonyms:
|
109
109
|
- "サラダ油"
|
110
110
|
- "サラダオイル"
|
111
|
+
- "オリーブオイル"
|
111
112
|
- "オイル"
|
112
113
|
- :key: :butter
|
113
114
|
:japanese_name: "バター"
|
@@ -169,3 +170,8 @@
|
|
169
170
|
:specific_gravity: 1.2
|
170
171
|
:synonyms:
|
171
172
|
- "ソース"
|
173
|
+
- :key: :mayonnaise
|
174
|
+
:japanese_name: "マヨネーズ"
|
175
|
+
:english_name: mayonnaise
|
176
|
+
:specific_gravity: 1.0
|
177
|
+
:synonyms: []
|
data/lib/shioconv/unit.rb
CHANGED
@@ -10,13 +10,13 @@ class Shioconv::Unit
|
|
10
10
|
cup: 200.0,
|
11
11
|
us_cup: 236.56,
|
12
12
|
jp_cup: 200.0,
|
13
|
-
},
|
13
|
+
}.freeze,
|
14
14
|
weight: {
|
15
15
|
g: 1.0,
|
16
16
|
kg: 1000.0,
|
17
17
|
oz: 28.349,
|
18
18
|
lb: 453.592,
|
19
|
-
},
|
19
|
+
}.freeze,
|
20
20
|
}.freeze
|
21
21
|
|
22
22
|
CONVERTABLE_UNITS = UNIT_TYPES.map { |_, units| units.keys }.flatten.freeze
|
@@ -37,7 +37,7 @@ class Shioconv::Unit
|
|
37
37
|
|
38
38
|
def self.list
|
39
39
|
UNIT_TYPES.map do |type, units|
|
40
|
-
(base_unit, _) = units.shift
|
40
|
+
(base_unit, _) = units.dup.shift
|
41
41
|
"#{type}: #{base_unit}, " << units.map { |unit, value| "#{unit}(#{value}#{base_unit})" }.join(', ')
|
42
42
|
end
|
43
43
|
end
|
data/lib/shioconv/version.rb
CHANGED
data/shioconv.gemspec
CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "coveralls", "~> 0.7"
|
24
25
|
end
|
data/spec/shioconv/unit_spec.rb
CHANGED
@@ -6,11 +6,15 @@ describe Shioconv::Unit do
|
|
6
6
|
|
7
7
|
describe '.convertable?' do
|
8
8
|
context 'when convertable unit given' do
|
9
|
-
specify { expect(described_class.convertable?(convertable_unit)).to
|
9
|
+
specify { expect(described_class.convertable?(convertable_unit)).to be_truthy }
|
10
10
|
end
|
11
11
|
|
12
12
|
context 'when not convertable unit given' do
|
13
|
-
specify { expect(described_class.convertable?(not_convertable_unit)).to
|
13
|
+
specify { expect(described_class.convertable?(not_convertable_unit)).to be_falsey }
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
describe '.list' do
|
18
|
+
specify { expect(described_class.list).to be_an Array }
|
19
|
+
end
|
16
20
|
end
|
data/spec/shioconv_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Shioconv do
|
|
27
27
|
let(:superclass_method) { :frozen? }
|
28
28
|
include_examples 'does not define instance method'
|
29
29
|
it 'delegates to superclass' do
|
30
|
-
expect(salt.send(superclass_method)).to
|
30
|
+
expect(salt.send(superclass_method)).to be_falsey
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -84,7 +84,7 @@ describe Shioconv do
|
|
84
84
|
expect(soy_source.to_tbsp).to be_within(0.01).of(1)
|
85
85
|
end
|
86
86
|
|
87
|
-
it 'converts correctly from cc to
|
87
|
+
it 'converts correctly from cc to us_cup' do
|
88
88
|
expect(soy_source.to_us_cup).to be_within(0.01).of(0.0634)
|
89
89
|
end
|
90
90
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shioconv
|
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
|
- SHIOYA, Hiromu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
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: '1.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.7'
|
55
69
|
description: Shioconv converts between weight and volume of typical condiments.
|
56
70
|
email:
|
57
71
|
- kwappa.856@gmail.com
|
@@ -59,7 +73,9 @@ executables: []
|
|
59
73
|
extensions: []
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
76
|
+
- ".coveralls.yml"
|
62
77
|
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
63
79
|
- Gemfile
|
64
80
|
- LICENSE.txt
|
65
81
|
- README.md
|
@@ -71,6 +87,7 @@ files:
|
|
71
87
|
- lib/shioconv/unit.rb
|
72
88
|
- lib/shioconv/version.rb
|
73
89
|
- shioconv.gemspec
|
90
|
+
- spec/shioconv/condiment_spec.rb
|
74
91
|
- spec/shioconv/unit_spec.rb
|
75
92
|
- spec/shioconv_spec.rb
|
76
93
|
- spec/spec_helper.rb
|
@@ -99,6 +116,7 @@ signing_key:
|
|
99
116
|
specification_version: 4
|
100
117
|
summary: Shioconv converts between weight and volume of typical condiments.
|
101
118
|
test_files:
|
119
|
+
- spec/shioconv/condiment_spec.rb
|
102
120
|
- spec/shioconv/unit_spec.rb
|
103
121
|
- spec/shioconv_spec.rb
|
104
122
|
- spec/spec_helper.rb
|