storexplore 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -2
- data/.travis.yml +6 -5
- data/README.md +2 -0
- data/lib/storexplore/testing/api_shared_context.rb +11 -5
- data/lib/storexplore/testing/configuration.rb +5 -0
- data/lib/storexplore/version.rb +1 -1
- data/spec/spec_helper.rb +8 -1
- data/storexplore.gemspec +7 -5
- data.tar.gz.sig +0 -0
- metadata +60 -34
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62ed201012136d3411fcb8d36033e956cbd257ee
|
4
|
+
data.tar.gz: 5cabaaaf2165ec4513fa74114114328ac219b019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc4456ffb7df629729938ddd041491682758f8d14c1d31f396e7d5a4971da9c9d989c0a8d9d84bd8069b7a8a0b29c9acbc9c99cd8b97ec1935adfbaa216f9536
|
7
|
+
data.tar.gz: b0cf18167eb27abee8ff815dae79e10f82904c085dec9ceb4ca1e3b99a42f01226f0c84f638b364bfac2588f077ae7fb9f29a9a6d702052279493225ed3cd71d
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
g�`��[����o}�r�e��&�<�zX����X�iZ����\}L�K������R����e��O,oR��%��a�g ���ϸy(��ߏ�>c����z�
|
2
|
+
i���R���h@I��d.��O��k^��Zo6ʚ���ի�
|
data/.travis.yml
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
+
- 2.1.1
|
3
4
|
- 2.0.0
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
script: bundle exec rake
|
6
|
+
|
7
|
+
addons:
|
8
|
+
code_climate:
|
9
|
+
repo_token: ca5035ef4dc8a3a37fd5968a9845b8713cd84b01638035625fa0acffaa238c84
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/philou/storexplore.svg?branch=master)](https://travis-ci.org/philou/storexplore) [![Test Coverage](https://codeclimate.com/github/philou/storexplore/badges/coverage.svg)](https://codeclimate.com/github/philou/storexplore) [![Code Climate](https://codeclimate.com/github/philou/storexplore/badges/gpa.svg)](https://codeclimate.com/github/philou/storexplore)
|
2
|
+
|
1
3
|
# Storexplore
|
2
4
|
|
3
5
|
A declarative scrapping DSL that lets one define directory like apis to an online store
|
@@ -19,18 +19,22 @@
|
|
19
19
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
20
|
# MA 02110-1301 USA
|
21
21
|
|
22
|
+
require 'timeout'
|
23
|
+
|
22
24
|
module Storexplore
|
23
25
|
module Testing
|
24
26
|
|
25
27
|
shared_context "a scrapped store" do
|
26
28
|
|
27
29
|
before :all do
|
28
|
-
|
30
|
+
Timeout::timeout(Testing.config.explore_store_items_timeout) do
|
31
|
+
@range = 0..1
|
29
32
|
|
30
|
-
|
33
|
+
expect(self).to(respond_to(:generate_store), "You should implement generate_store to include the scrapped store shared context")
|
31
34
|
|
32
|
-
|
33
|
-
|
35
|
+
self.store = generate_store
|
36
|
+
explore_store
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
def explore_store
|
@@ -51,8 +55,10 @@ module Storexplore
|
|
51
55
|
|
52
56
|
def dig_deep(categories)
|
53
57
|
all_categories = [categories]
|
58
|
+
items = []
|
54
59
|
|
55
|
-
while
|
60
|
+
while not categories.empty? and items.empty?
|
61
|
+
items = dig(categories, :items)
|
56
62
|
categories = dig(categories, :categories)
|
57
63
|
all_categories << categories
|
58
64
|
end
|
@@ -39,6 +39,7 @@ module Storexplore
|
|
39
39
|
def initialize
|
40
40
|
@logger = Logger.new(STDOUT)
|
41
41
|
@logger.level = Logger::INFO
|
42
|
+
@explore_store_items_timeout = 5*60
|
42
43
|
end
|
43
44
|
|
44
45
|
# Sets the generation directory where the dummy stores will be generated.
|
@@ -61,6 +62,10 @@ module Storexplore
|
|
61
62
|
# info level.
|
62
63
|
attr_accessor :logger
|
63
64
|
|
65
|
+
# Timeout for a the initial test exploration of the items of a store. By default,
|
66
|
+
# 5 minutes
|
67
|
+
attr_accessor :explore_store_items_timeout
|
68
|
+
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
data/lib/storexplore/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -19,7 +19,11 @@
|
|
19
19
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
20
|
# MA 02110-1301 USA
|
21
21
|
|
22
|
+
require 'codeclimate-test-reporter'
|
23
|
+
CodeClimate::TestReporter.start
|
24
|
+
|
22
25
|
require 'fakeweb'
|
26
|
+
require 'rspec/collection_matchers'
|
23
27
|
require 'spec_combos'
|
24
28
|
require 'storexplore'
|
25
29
|
require 'storexplore/testing'
|
@@ -30,9 +34,12 @@ Storexplore::Testing.config do |config|
|
|
30
34
|
end
|
31
35
|
|
32
36
|
# Clean up fakeweb registry after every test
|
33
|
-
FakeWeb.allow_net_connect = false
|
34
37
|
RSpec.configure do |config|
|
38
|
+
config.before :each do
|
39
|
+
FakeWeb.allow_net_connect = false
|
40
|
+
end
|
35
41
|
config.after(:each) do
|
36
42
|
FakeWeb.clean_registry
|
43
|
+
FakeWeb.allow_net_connect = true
|
37
44
|
end
|
38
45
|
end
|
data/storexplore.gemspec
CHANGED
@@ -20,9 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "mechanize", "~> 2.0"
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler"
|
24
|
-
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "guard-rspec"
|
26
|
-
spec.add_development_dependency "spec_combos"
|
27
|
-
spec.add_development_dependency "fakeweb"
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "guard-rspec"
|
26
|
+
spec.add_development_dependency "spec_combos"
|
27
|
+
spec.add_development_dependency "fakeweb"
|
28
|
+
spec.add_development_dependency "rspec-collection_matchers"
|
29
|
+
spec.add_development_dependency "codeclimate-test-reporter"
|
28
30
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storexplore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philou
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDQjCCAiqgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBHMRkwFwYDVQQDDBBwaGls
|
14
14
|
aXBwZS5ib3VyZ2F1MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/Is
|
15
|
-
|
15
|
+
ZAEZFgNjb20wHhcNMTQxMTA0MDUwNTA4WhcNMTUxMTA0MDUwNTA4WjBHMRkwFwYD
|
16
16
|
VQQDDBBwaGlsaXBwZS5ib3VyZ2F1MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzAR
|
17
17
|
BgoJkiaJk/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
18
18
|
AQC8CpoqZwEbzXr55EUxdSplgn0MYZ9xPGO/XmRa8bD63n+JYWF0AS+mj452ZY18
|
@@ -20,18 +20,16 @@ cert_chain:
|
|
20
20
|
qGp0Jw1HfPNUMVa+3pXZyAGCecN6rTnsZJIuW6KNaJUq6lEMVXanoTHgAKrH5aHd
|
21
21
|
Y6ofwQL86d6LDkC1S4p86iMUWvF34w8h5ItVo+JKlPRR22rzsK/ZKgNH3lfjbS6i
|
22
22
|
JWqPva70rL2xz5kCVn6DL7XhNZtqnAO4kvCQyQeWezvcoGXEnbHacKky7B+/WKec
|
23
|
-
OIWEwedl6j+
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
yLcl1cmm5ALtJ/+Bkkmp0i4amXeTDMvq9r8PBsVsQwxYOYJBP+Umxz3PX6HjFHrQ
|
32
|
-
XdkXx3oZ
|
23
|
+
OIWEwedl6j+X0OD5OYki3QaTAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQD
|
24
|
+
AgSwMB0GA1UdDgQWBBSZy8+NDp7v3X6S0oqVORYE8uli5jANBgkqhkiG9w0BAQUF
|
25
|
+
AAOCAQEAjTpuKjUclY0kNioKIcwD9nEkAwxeGiMNrY2zc7FfabSVhNKa0GafjHiz
|
26
|
+
6STN4S4j03wgmD8YMnA6uqQBSCgb3mcySr9sfglxub4sC9c3Ma+A3G7JEE+KPeLE
|
27
|
+
gcVYqRPSgVV5naFYaFu4HK0o8ZY8smY30BM3uFmW3cQ9cTKNtaqgUQ177fMmXuYa
|
28
|
+
QOTMg5o5t1YFdpg/RwQNoUX5DyAC8gWJY8vlVJbiIKvvB0z4+o7d5nEuuE3jvKQr
|
29
|
+
LKjGZUoe+A3/FKYHWLPZAArCXrXLhpjAfopLBNmOAju0e30ObcjPQDWcj7z5jfJl
|
30
|
+
ILiFgo6hdHrp/tFaDv14PiMRm6sZaQ==
|
33
31
|
-----END CERTIFICATE-----
|
34
|
-
date: 2014-
|
32
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
35
33
|
dependencies:
|
36
34
|
- !ruby/object:Gem::Dependency
|
37
35
|
name: mechanize
|
@@ -51,72 +49,100 @@ dependencies:
|
|
51
49
|
name: bundler
|
52
50
|
requirement: !ruby/object:Gem::Requirement
|
53
51
|
requirements:
|
54
|
-
- -
|
52
|
+
- - '>='
|
55
53
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
54
|
+
version: '0'
|
57
55
|
type: :development
|
58
56
|
prerelease: false
|
59
57
|
version_requirements: !ruby/object:Gem::Requirement
|
60
58
|
requirements:
|
61
|
-
- -
|
59
|
+
- - '>='
|
62
60
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
61
|
+
version: '0'
|
64
62
|
- !ruby/object:Gem::Dependency
|
65
63
|
name: rake
|
66
64
|
requirement: !ruby/object:Gem::Requirement
|
67
65
|
requirements:
|
68
|
-
- -
|
66
|
+
- - '>='
|
69
67
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
68
|
+
version: '0'
|
71
69
|
type: :development
|
72
70
|
prerelease: false
|
73
71
|
version_requirements: !ruby/object:Gem::Requirement
|
74
72
|
requirements:
|
75
|
-
- -
|
73
|
+
- - '>='
|
76
74
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
75
|
+
version: '0'
|
78
76
|
- !ruby/object:Gem::Dependency
|
79
77
|
name: guard-rspec
|
80
78
|
requirement: !ruby/object:Gem::Requirement
|
81
79
|
requirements:
|
82
|
-
- -
|
80
|
+
- - '>='
|
83
81
|
- !ruby/object:Gem::Version
|
84
|
-
version: '
|
82
|
+
version: '0'
|
85
83
|
type: :development
|
86
84
|
prerelease: false
|
87
85
|
version_requirements: !ruby/object:Gem::Requirement
|
88
86
|
requirements:
|
89
|
-
- -
|
87
|
+
- - '>='
|
90
88
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
89
|
+
version: '0'
|
92
90
|
- !ruby/object:Gem::Dependency
|
93
91
|
name: spec_combos
|
94
92
|
requirement: !ruby/object:Gem::Requirement
|
95
93
|
requirements:
|
96
|
-
- -
|
94
|
+
- - '>='
|
97
95
|
- !ruby/object:Gem::Version
|
98
|
-
version: '0
|
96
|
+
version: '0'
|
99
97
|
type: :development
|
100
98
|
prerelease: false
|
101
99
|
version_requirements: !ruby/object:Gem::Requirement
|
102
100
|
requirements:
|
103
|
-
- -
|
101
|
+
- - '>='
|
104
102
|
- !ruby/object:Gem::Version
|
105
|
-
version: '0
|
103
|
+
version: '0'
|
106
104
|
- !ruby/object:Gem::Dependency
|
107
105
|
name: fakeweb
|
108
106
|
requirement: !ruby/object:Gem::Requirement
|
109
107
|
requirements:
|
110
|
-
- -
|
108
|
+
- - '>='
|
111
109
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
110
|
+
version: '0'
|
113
111
|
type: :development
|
114
112
|
prerelease: false
|
115
113
|
version_requirements: !ruby/object:Gem::Requirement
|
116
114
|
requirements:
|
117
|
-
- -
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: rspec-collection_matchers
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: codeclimate-test-reporter
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :development
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
118
144
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
145
|
+
version: '0'
|
120
146
|
description: A declarative scrapping DSL that lets one define directory like apis
|
121
147
|
to an online store
|
122
148
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|