yummly 0.0.9 → 0.0.10
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/.gitignore +3 -0
- data/README.md +5 -3
- data/lib/yummly.rb +6 -0
- data/lib/yummly/api.rb +3 -3
- data/lib/yummly/attribution.rb +18 -0
- data/lib/yummly/configuration.rb +3 -1
- data/lib/yummly/connection.rb +22 -39
- data/lib/yummly/faraday_adapter.rb +14 -0
- data/lib/yummly/recipe.rb +1 -1
- data/lib/yummly/search_result.rb +42 -0
- data/lib/yummly/url_builder.rb +33 -0
- data/lib/yummly/version.rb +1 -1
- data/spec/fixtures/search_response.txt +1609 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/url_mocks.rb +8 -0
- data/spec/yummly_spec.rb +5 -3
- data/yummly.gemspec +1 -0
- metadata +25 -2
data/spec/spec_helper.rb
CHANGED
data/spec/url_mocks.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
module UrlMocks
|
2
|
+
def self.register_api_url_stubs
|
3
|
+
File.open(File.join(File.dirname(__FILE__), "fixtures", "search_response.txt")) do |file|
|
4
|
+
WebMock::API.stub_request(:get, Regexp.new(Yummly::Connection.domain + "/v1/api/recipes?" + ".*")).to_return(status: 200, body: file)
|
5
|
+
end
|
6
|
+
#stub_request(:any, Regexp.new(Yummly::Connection.domain + ".*")).to_return(:body => "Catch all error until urls are defined.", :status => 501 )
|
7
|
+
end
|
8
|
+
end
|
data/spec/yummly_spec.rb
CHANGED
@@ -4,9 +4,8 @@ describe Yummly do
|
|
4
4
|
subject { Yummly::Configuration.new }
|
5
5
|
|
6
6
|
describe ".configure" do
|
7
|
-
|
8
|
-
let(:
|
9
|
-
let(:app_key) { "XEARSGSTH12345789" }
|
7
|
+
let(:app_id) { ENV['YUMMLY_APP_ID'] || "12345" }
|
8
|
+
let(:app_key) { ENV['YUMMLY_APP_KEY'] || "XEARSGSTH12345789" }
|
10
9
|
|
11
10
|
before do
|
12
11
|
Yummly.configure do |config|
|
@@ -14,11 +13,14 @@ describe Yummly do
|
|
14
13
|
config.app_id = app_id
|
15
14
|
config.app_key = app_key
|
16
15
|
end
|
16
|
+
|
17
|
+
UrlMocks.register_api_url_stubs
|
17
18
|
end
|
18
19
|
|
19
20
|
specify { Yummly.configuration.use_ssl?.should be_true }
|
20
21
|
specify { Yummly.configuration.app_id.should == app_id }
|
21
22
|
specify { Yummly.configuration.app_key.should == app_key }
|
23
|
+
specify { Yummly.search("soup recipes").should be_an_instance_of(Array)}
|
22
24
|
end
|
23
25
|
|
24
26
|
end
|
data/yummly.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yummly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Mills
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
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'
|
69
83
|
description: Ruby wrapper to the Yummly API
|
70
84
|
email:
|
71
85
|
- twmills@twmills.com
|
@@ -81,17 +95,23 @@ files:
|
|
81
95
|
- Rakefile
|
82
96
|
- lib/yummly.rb
|
83
97
|
- lib/yummly/api.rb
|
98
|
+
- lib/yummly/attribution.rb
|
84
99
|
- lib/yummly/configuration.rb
|
85
100
|
- lib/yummly/connection.rb
|
101
|
+
- lib/yummly/faraday_adapter.rb
|
86
102
|
- lib/yummly/flavor.rb
|
87
103
|
- lib/yummly/image.rb
|
88
104
|
- lib/yummly/nutrition_estimate.rb
|
89
105
|
- lib/yummly/recipe.rb
|
106
|
+
- lib/yummly/search_result.rb
|
90
107
|
- lib/yummly/source.rb
|
91
108
|
- lib/yummly/unit.rb
|
109
|
+
- lib/yummly/url_builder.rb
|
92
110
|
- lib/yummly/version.rb
|
93
111
|
- spec/configuration_spec.rb
|
112
|
+
- spec/fixtures/search_response.txt
|
94
113
|
- spec/spec_helper.rb
|
114
|
+
- spec/url_mocks.rb
|
95
115
|
- spec/yummly_spec.rb
|
96
116
|
- yummly.gemspec
|
97
117
|
homepage: https://github.com/twmills/yummly
|
@@ -119,5 +139,8 @@ specification_version: 4
|
|
119
139
|
summary: Ruby wrapper to the Yummly API
|
120
140
|
test_files:
|
121
141
|
- spec/configuration_spec.rb
|
142
|
+
- spec/fixtures/search_response.txt
|
122
143
|
- spec/spec_helper.rb
|
144
|
+
- spec/url_mocks.rb
|
123
145
|
- spec/yummly_spec.rb
|
146
|
+
has_rdoc:
|