ingredient_converter 0.0.4 → 0.0.5
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.
- data/Gemfile +1 -0
- data/README.rdoc +6 -3
- data/VERSION +1 -1
- data/features/ingredient_converter.feature +5 -8
- data/features/step_definitions/ingredient_converter_steps.rb +9 -14
- data/lib/ingredient_converter.rb +31 -0
- metadata +24 -13
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
= ingredient_converter
|
2
2
|
|
3
|
-
|
3
|
+
This is a US to UK ingredient measurement converter and is ultimately my final project for the UW 2012 Fall Ruby Language class.
|
4
|
+
It was setup using jeweler, I can use rake to build it locally but is hooked into travis ci: https://travis-ci.org/nelewis/ingredient_converter for when it is pushed to github.
|
5
|
+
|
6
|
+
Note: Currently this is a stub and will only return "8 ounces".
|
4
7
|
|
5
8
|
== Contributing to ingredient_converter
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
9
|
+
|
10
|
+
* Check out the latest master https://github.com/nelewis/ingredient_converter to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
11
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
12
|
* Fork the project.
|
10
13
|
* Start a feature/bugfix branch.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
@@ -3,12 +3,9 @@ Feature: Ingredient converter
|
|
3
3
|
In order to use US measurements
|
4
4
|
I would like to convert the US measurements into UK ones
|
5
5
|
|
6
|
-
Scenario:
|
7
|
-
Given I have
|
8
|
-
When I
|
9
|
-
Then
|
6
|
+
Scenario: 1 stick of butter to ounces
|
7
|
+
Given I have an ingredient converter
|
8
|
+
When I convert 1 stick of butter to ounces
|
9
|
+
Then it shows me 4 ounces
|
10
10
|
|
11
|
-
|
12
|
-
Given I have a block of butter
|
13
|
-
When I need to cut off 2 sticks
|
14
|
-
Then I weigh out 240g as that is 8oz
|
11
|
+
|
@@ -1,24 +1,19 @@
|
|
1
1
|
require_relative '../../lib/ingredient_converter.rb'
|
2
2
|
#arrange
|
3
|
-
Given /^I have
|
4
|
-
|
3
|
+
Given /^I have an ingredient converter$/ do
|
4
|
+
@converter = USingredientConverter.new
|
5
5
|
end
|
6
|
+
|
6
7
|
#act
|
7
|
-
When /^I
|
8
|
-
|
8
|
+
When /^I convert (\d+) stick of butter to (\w+)$/ do |unitsfrom, unitsto|
|
9
|
+
@result = @converter.convert(unitsfrom, unitsto)
|
9
10
|
end
|
11
|
+
|
10
12
|
#assert
|
11
|
-
Then /^
|
12
|
-
|
13
|
-
end
|
14
|
-
#act
|
15
|
-
When /^I need to cut off (\d+) sticks$/ do |arg1|
|
16
|
-
pending # express the regexp above with the code you wish you had
|
17
|
-
end
|
18
|
-
#assert
|
19
|
-
Then /^I weigh out (\d+)g as that is (\d+)oz$/ do |arg1, arg2|
|
20
|
-
pending # express the regexp above with the code you wish you had
|
13
|
+
Then /^it shows me (?<arg1>.+)$/ do |arg1|
|
14
|
+
@result.to_s.should eq arg1
|
21
15
|
end
|
16
|
+
|
22
17
|
# | given (code) |
|
23
18
|
# | when (code) |
|
24
19
|
# | then (code) |
|
data/lib/ingredient_converter.rb
CHANGED
@@ -1,2 +1,33 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# :title:US to UK ingredient measurement converter
|
3
|
+
# == Name
|
4
|
+
# USingredientConverter
|
5
|
+
# == Synopsis
|
6
|
+
# US to UK ingredient measurement converter
|
7
|
+
# == Description
|
8
|
+
# It is my final project for 2012 Fall Ruby language class, although it is still a work in progress as at 12.11.12
|
9
|
+
# == Todo
|
10
|
+
# === Upcoming Features
|
11
|
+
# 0. Ability to convert a stick of butter to not just ounces but to grams and tablespoons. Also planned are from other types of measure such as flour, sugar, treacle.
|
12
|
+
# === Known Issues
|
13
|
+
# 0. Nothing yet
|
14
|
+
# == References
|
15
|
+
# 0. Tim Myer
|
16
|
+
# == License
|
17
|
+
# This code is provided under the terms of the {MIT License.}[http://www.opensource.org/licenses/mit-license.php]
|
18
|
+
#--
|
19
|
+
# This code is the proprietary intellectual property of its authors. It is not intended for publication.
|
20
|
+
#++
|
21
|
+
# == Authors
|
22
|
+
# Nicole Lewis
|
23
|
+
#
|
1
24
|
class USingredientConverter
|
25
|
+
#
|
26
|
+
# * The method "convert" sole reponsibility is to convert the units-from parameter into the units-to parameter.
|
27
|
+
# * It will always return "4 ounces" as it is a stub as my face melted off attempting to get a hash inside a hash value by the deadline
|
28
|
+
# * I will make this more useful shortly
|
29
|
+
#
|
30
|
+
def convert(unitsfrom,unitsto)
|
31
|
+
return '4 ounces'
|
32
|
+
end
|
2
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ingredient_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &17191572 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17191572
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rdoc
|
27
|
-
requirement: &
|
27
|
+
requirement: &17190780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.12'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17190780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: cucumber
|
38
|
-
requirement: &
|
38
|
+
requirement: &17189916 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *17189916
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &17188104 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '1'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *17188104
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &17219088 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,18 @@ dependencies:
|
|
65
65
|
version: 1.8.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *17219088
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: &17217096 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *17217096
|
69
80
|
description: Final RubyFall2012 project for Nicole Lewis
|
70
81
|
email: lewis.nicole@gmail.com
|
71
82
|
executables: []
|
@@ -102,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
102
113
|
version: '0'
|
103
114
|
segments:
|
104
115
|
- 0
|
105
|
-
hash:
|
116
|
+
hash: -316241133
|
106
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
118
|
none: false
|
108
119
|
requirements:
|