brand2csv 0.1.2 → 0.1.3
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/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/bin/brand2csv +52 -0
- data/lib/brand2csv/version.rb +1 -1
- metadata +4 -2
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/bin/brand2csv
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
root = Pathname.new(__FILE__).realpath.parent.parent
|
5
|
+
$:.unshift root.join('lib') if $0 == __FILE__
|
6
|
+
|
7
|
+
require 'optparse'
|
8
|
+
require 'brand2csv'
|
9
|
+
|
10
|
+
def help
|
11
|
+
<<EOS
|
12
|
+
#$0 ver.#{Brand2csv::VERSION}
|
13
|
+
Usage:
|
14
|
+
#{File.basename(__FILE__)} timespan
|
15
|
+
Find all brands registered in switzerland during the given timespan.
|
16
|
+
The following examples valid timespan periods:
|
17
|
+
1.10.2005
|
18
|
+
1.10.2005-31.10.2005
|
19
|
+
1.10.2005, 5.10.2005-31.10.2005
|
20
|
+
The results are stored in the file ausgabe.csv.
|
21
|
+
The trademark name is either a real brand name or a link to an image.
|
22
|
+
EOS
|
23
|
+
end
|
24
|
+
|
25
|
+
parser = OptionParser.new
|
26
|
+
opts = {}
|
27
|
+
parser.on_tail('-h', '--help') { puts help; exit }
|
28
|
+
|
29
|
+
args = ARGV.dup
|
30
|
+
begin
|
31
|
+
parser.parse!(args)
|
32
|
+
rescue OptionParser::MissingArgument,
|
33
|
+
OptionParser::InvalidArgument,
|
34
|
+
OptionParser::InvalidOption
|
35
|
+
puts help
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
unless args.size == 1
|
41
|
+
puts help
|
42
|
+
exit 1
|
43
|
+
end
|
44
|
+
|
45
|
+
begin
|
46
|
+
Brand2csv::run(args[0])
|
47
|
+
rescue Interrupt
|
48
|
+
puts "Unterbrochen. Breche mit Fehler ab"
|
49
|
+
exit 1
|
50
|
+
end
|
51
|
+
|
52
|
+
puts "#{__FILE__} completed successfully" if $VERBOSE
|
data/lib/brand2csv/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brand2csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -95,7 +95,8 @@ description: ! "brand2csv creates csv files for swiss brand registered in a spec
|
|
95
95
|
time period. \n The csv contains the brand, link to image (if present), link to
|
96
96
|
the detailinfo at swissreg.ch, name and address of owner (Inhaber)"
|
97
97
|
email: yasaka@ywesee.com, zdavatz@ywesee.com
|
98
|
-
executables:
|
98
|
+
executables:
|
99
|
+
- brand2csv
|
99
100
|
extensions: []
|
100
101
|
extra_rdoc_files:
|
101
102
|
- History.txt
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- Manifest.txt
|
114
115
|
- README.md
|
115
116
|
- Rakefile
|
117
|
+
- bin/brand2csv
|
116
118
|
- lib/brand2csv.rb
|
117
119
|
- lib/brand2csv/version.rb
|
118
120
|
- protocol.2013.05.12.textile
|