brand2csv 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -4
- data/Gemfile.lock +2 -2
- data/History.txt +5 -0
- data/bin/brand2csv +27 -27
- data/lib/brand2csv/version.rb +1 -1
- metadata +101 -123
data/Gemfile
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
gem 'mechanize'
|
3
3
|
gem 'json', '~> 1.7.7'
|
4
|
-
gem 'nokogiri'
|
5
|
-
|
4
|
+
gem 'nokogiri', '~> 1.5.10'
|
6
5
|
|
7
6
|
group :development do
|
8
7
|
gem 'watir'
|
9
8
|
gem 'watir-webdriver'
|
10
|
-
|
9
|
+
|
11
10
|
gem 'rspec'
|
12
11
|
gem 'webmock'
|
13
12
|
gem 'hoe', '>= 3.4'
|
14
13
|
gem 'rdoc'
|
15
|
-
# gem 'pry'
|
16
14
|
end
|
data/Gemfile.lock
CHANGED
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
multi_json (1.7.5)
|
29
29
|
net-http-digest_auth (1.3)
|
30
30
|
net-http-persistent (2.8)
|
31
|
-
nokogiri (1.5.
|
31
|
+
nokogiri (1.5.10)
|
32
32
|
ntlm-http (0.1.1)
|
33
33
|
rake (10.0.4)
|
34
34
|
rdoc (4.0.1)
|
@@ -68,7 +68,7 @@ DEPENDENCIES
|
|
68
68
|
hoe (>= 3.4)
|
69
69
|
json (~> 1.7.7)
|
70
70
|
mechanize
|
71
|
-
nokogiri
|
71
|
+
nokogiri (~> 1.5.10)
|
72
72
|
rdoc
|
73
73
|
rspec
|
74
74
|
watir
|
data/History.txt
CHANGED
data/bin/brand2csv
CHANGED
@@ -28,7 +28,7 @@ def validates_timespan(arg)
|
|
28
28
|
timespan = ""
|
29
29
|
dates = arg.gsub(/[^\d\.-]/, '').split("-")
|
30
30
|
catch (:error) do
|
31
|
-
dates.
|
31
|
+
dates.each_with_index do |d, i|
|
32
32
|
sep = (dates.length > 1 && i != 0) ? "-" : ""
|
33
33
|
begin
|
34
34
|
Date.parse(d)
|
@@ -62,39 +62,39 @@ def validates_timespan(arg)
|
|
62
62
|
[valid, message]
|
63
63
|
end
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
parser.on_tail('-h', '--help') { puts help; exit }
|
65
|
+
parser = OptionParser.new
|
66
|
+
opts = {}
|
67
|
+
parser.on('--swiss_only') {|v| opts[:swiss_only] = true }
|
68
|
+
parser.on_tail('-h', '--help') { puts help; exit }
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
70
|
+
args = ARGV.dup
|
71
|
+
begin
|
72
|
+
parser.parse!(args)
|
73
|
+
rescue OptionParser::MissingArgument,
|
74
|
+
OptionParser::InvalidArgument,
|
75
|
+
OptionParser::InvalidOption
|
76
|
+
puts help
|
77
|
+
exit 1
|
78
|
+
end
|
80
79
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
80
|
+
unless args.size >= 1
|
81
|
+
puts help
|
82
|
+
exit 1
|
83
|
+
end
|
85
84
|
|
85
|
+
unless args.empty?
|
86
86
|
valid,message = validates_timespan(args[0])
|
87
87
|
unless valid
|
88
88
|
puts message
|
89
89
|
exit 1
|
90
90
|
end
|
91
|
+
end
|
91
92
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
puts "#{__FILE__} completed successfully" if $VERBOSE
|
93
|
+
begin
|
94
|
+
Brand2csv::run(args[0], args[1], opts[:swiss_only])
|
95
|
+
rescue Interrupt
|
96
|
+
puts "Unterbrochen. Breche mit Fehler ab"
|
97
|
+
exit 1
|
100
98
|
end
|
99
|
+
|
100
|
+
puts "#{__FILE__} completed successfully" if $VERBOSE
|
data/lib/brand2csv/version.rb
CHANGED
metadata
CHANGED
@@ -1,140 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: brand2csv
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Niklaus Giger, Zeno R.R. Davatz
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-08-26 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: mechanize
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '2.6'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '2.6'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rspec
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
22
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: webmock
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
49
24
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 15
|
29
|
+
segments:
|
30
|
+
- 2
|
31
|
+
- 6
|
32
|
+
version: "2.6"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rdoc
|
55
37
|
prerelease: false
|
56
|
-
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
57
39
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.4'
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 27
|
44
|
+
segments:
|
45
|
+
- 4
|
46
|
+
- 0
|
47
|
+
version: "4.0"
|
70
48
|
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
71
52
|
prerelease: false
|
72
|
-
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
73
54
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
86
62
|
type: :development
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: webmock
|
87
66
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rdoc
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
97
68
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
102
76
|
type: :development
|
103
|
-
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '3.10'
|
110
|
-
- !ruby/object:Gem::Dependency
|
77
|
+
version_requirements: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
111
79
|
name: hoe
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '2.13'
|
118
|
-
type: :development
|
119
80
|
prerelease: false
|
120
|
-
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
121
82
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 15
|
87
|
+
segments:
|
88
|
+
- 3
|
89
|
+
- 4
|
90
|
+
version: "3.4"
|
91
|
+
type: :development
|
92
|
+
version_requirements: *id005
|
93
|
+
description: |-
|
94
|
+
brand2csv creates csv files for swiss brand registered in a specific time period.
|
95
|
+
The csv contains the brand, link to image (if present), link to the detailinfo at swissreg.ch, name and address of owner (Inhaber)
|
129
96
|
email: yasaka@ywesee.com, zdavatz@ywesee.com
|
130
|
-
executables:
|
97
|
+
executables:
|
131
98
|
- brand2csv
|
132
99
|
extensions: []
|
133
|
-
|
100
|
+
|
101
|
+
extra_rdoc_files:
|
134
102
|
- History.txt
|
135
103
|
- LICENCE.txt
|
136
104
|
- Manifest.txt
|
137
|
-
|
105
|
+
- README.md
|
106
|
+
files:
|
138
107
|
- .gitignore
|
139
108
|
- .rspec
|
140
109
|
- .travis.yml
|
@@ -180,30 +149,39 @@ files:
|
|
180
149
|
- spike_watir.rb
|
181
150
|
- swissreg.rb
|
182
151
|
- .gemtest
|
183
|
-
homepage:
|
152
|
+
homepage: https://github.com/zdavatz/brand2csv
|
184
153
|
licenses: []
|
154
|
+
|
185
155
|
post_install_message:
|
186
|
-
rdoc_options:
|
156
|
+
rdoc_options:
|
187
157
|
- --main
|
188
|
-
- README.
|
189
|
-
require_paths:
|
158
|
+
- README.md
|
159
|
+
require_paths:
|
190
160
|
- lib
|
191
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
192
162
|
none: false
|
193
|
-
requirements:
|
194
|
-
- -
|
195
|
-
- !ruby/object:Gem::Version
|
196
|
-
|
197
|
-
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
hash: 3
|
167
|
+
segments:
|
168
|
+
- 0
|
169
|
+
version: "0"
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
171
|
none: false
|
199
|
-
requirements:
|
200
|
-
- -
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
203
179
|
requirements: []
|
180
|
+
|
204
181
|
rubyforge_project: brand2csv
|
205
182
|
rubygems_version: 1.8.25
|
206
183
|
signing_key:
|
207
184
|
specification_version: 3
|
208
185
|
summary: brand2csv creates csv files for swiss brands.
|
209
186
|
test_files: []
|
187
|
+
|