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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f61eb16a780a38b34e99d8b26090c0925f161ffd
4
- data.tar.gz: b7aa1e9ec47530035666203b279062239744fd0d
3
+ metadata.gz: 3296e6bcb23533da813a6b21eae5308f858cf6f1
4
+ data.tar.gz: e31fe0cbc866f9b9f96b0c2f39b15c973971860f
5
5
  SHA512:
6
- metadata.gz: 98a0d12b6d9e3e458d9ef9ebbc5d92309a97523fdd2518c89ed16ef5a03add5db4b2bb559f47b810ef7882fd364b2fbde3bdb229108706a628ce3b92444eabdd
7
- data.tar.gz: 2346c916108d4e4a12c3926e0c4950d12719f698f25ef4f9a061172511aa03ba007d70de4aa4d6f6d46740d25cf2298b75fa8453d4f1c440d6a3834fe5fd82f6
6
+ metadata.gz: 75339d09eef387eed0b70e7f8cba3ea447f0ae765ec2ac64e62dd6cc6f25de2ea2962e4dc1506320ddf28f8af32a2a7e02632a0e3bba2d8ececb76e2f90f93d4
7
+ data.tar.gz: 9163594a1a542d3967d6c15b7108db2c8ae33bdb012bdf653d002ed0bfb9e53a74fb0a1ca0bbca4ed80a36571095cf180024c9e676ac4a074d1b68035325c14c
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-ci
2
+ repo_token: 42Djwt1hUhhPAPgTHKns9efuRYFSZxHg7
data/.gitignore CHANGED
@@ -21,4 +21,4 @@ tmp
21
21
  *.a
22
22
  mkmf.log
23
23
  config/condiments.tsv
24
-
24
+ vendor
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.1
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in shioconv.gemspec
4
2
  gemspec
3
+
4
+ gem 'rspec', '~> 3.0.0'
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Shioconv
2
2
 
3
- convert between cubic contents and weight for typcal seasonings.
3
+ convert between volumes and weight for typcal condiments.
4
+
5
+ [![Build Status](https://travis-ci.org/kwappa/shioconv.png)](https://travis-ci.org/kwappa/shioconv)
6
+
7
+ [![Coverage Status](https://coveralls.io/repos/kwappa/shioconv/badge.png?branch=master)](https://coveralls.io/r/kwappa/shioconv?branch=master)
8
+
9
+ [![Code Climate](https://codeclimate.com/github/kwappa/shioconv.png)](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
@@ -3,7 +3,9 @@ require "bundler/gem_tasks"
3
3
  Bundler.setup
4
4
  require 'rspec/core/rake_task'
5
5
 
6
+ task default: :spec
7
+
6
8
  desc "run spec"
7
9
  RSpec::Core::RakeTask.new(:spec) do |t|
8
- t.rspec_opts = ["-c", "-fs"]
10
+ t.rspec_opts = ["-c", "-fd"]
9
11
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  class Shioconv
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.6"
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
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Shioconv::Condiment do
4
+ describe '.list' do
5
+ specify { expect(described_class.list).to be_an Array }
6
+ end
7
+ end
@@ -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 be_true }
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 be_false }
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
@@ -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 be_false
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 us_cpu' do
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
@@ -1,4 +1,8 @@
1
1
  require 'bundler'
2
2
  Bundler.setup(:default, :test)
3
3
  $: << File.join(File.dirname(File.expand_path(__FILE__)), %w[.. lib])
4
+
5
+ require 'coveralls'
6
+ Coveralls.wear!
7
+
4
8
  require 'shioconv'
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.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-04-06 00:00:00.000000000 Z
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.6'
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.6'
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