zueribad 0.1.0
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/.gitignore +17 -0
- data/.rspec +1 -0
- data/.rvmrc +48 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +27 -0
- data/Rakefile +8 -0
- data/bin/zueribad +10 -0
- data/lib/zueribad/application.rb +65 -0
- data/lib/zueribad/bath.rb +47 -0
- data/lib/zueribad/version.rb +3 -0
- data/lib/zueribad.rb +14 -0
- data/spec/application_spec.rb +47 -0
- data/spec/bath_spec.rb +49 -0
- data/spec/fixtures/baths.xml +155 -0
- data/zueribad.gemspec +23 -0
- metadata +136 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--format NyanCatFormatter
|
data/.rvmrc
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
+
# development environment upon cd'ing into the directory
|
5
|
+
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
+
# Only full ruby name is supported here, for short names use:
|
8
|
+
# echo "rvm use 1.9.3" > .rvmrc
|
9
|
+
environment_id="ruby-1.9.3-p194@zueribad"
|
10
|
+
|
11
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
+
# rvmrc_rvm_version="1.13.0 (stable)" # 1.10.1 seams as a safe start
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
+
# return 1
|
16
|
+
# }
|
17
|
+
|
18
|
+
# First we attempt to load the desired environment directly from the environment
|
19
|
+
# file. This is very fast and efficient compared to running through the entire
|
20
|
+
# CLI and selector. If you want feedback on which environment was used then
|
21
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
+
then
|
25
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
+
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
+
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
+
else
|
29
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
30
|
+
rvm --create "$environment_id" || {
|
31
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
32
|
+
return 1
|
33
|
+
}
|
34
|
+
fi
|
35
|
+
|
36
|
+
# If you use bundler, this might be useful to you:
|
37
|
+
# if [[ -s Gemfile ]] && {
|
38
|
+
# ! builtin command -v bundle >/dev/null ||
|
39
|
+
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
40
|
+
# }
|
41
|
+
# then
|
42
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
43
|
+
# gem install bundler
|
44
|
+
# fi
|
45
|
+
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
46
|
+
# then
|
47
|
+
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
48
|
+
# fi
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 koffeinfrei
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Zueribad
|
2
|
+
|
3
|
+
Displays the temperature and additional information about all municipal baths in Zurich.
|
4
|
+
|
5
|
+
The data is provided by the [school and sports department of the city of Zurich](http://www.stadt-zuerich.ch/ssd/de/index/sport/schwimmen.html).
|
6
|
+
|
7
|
+
This is the CLI written in ruby.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
$ gem install zueribad
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
# show all baths
|
16
|
+
$ zueribad
|
17
|
+
|
18
|
+
# show baths containing 'letten' in their name
|
19
|
+
$ zueribad -n letten
|
20
|
+
|
21
|
+
## Contributing
|
22
|
+
|
23
|
+
1. Fork it
|
24
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
25
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
26
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
27
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/zueribad
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# koffeinfrei zueribad-rb
|
4
|
+
# copyright (C) 2011 alexis reigel
|
5
|
+
#
|
6
|
+
# license: gpl v3
|
7
|
+
|
8
|
+
module Zueribad
|
9
|
+
class Application
|
10
|
+
|
11
|
+
def self.run
|
12
|
+
app = Application.new
|
13
|
+
app.options
|
14
|
+
app.baths
|
15
|
+
app.output
|
16
|
+
end
|
17
|
+
|
18
|
+
def baths
|
19
|
+
if @baths.nil?
|
20
|
+
if options.has_key?(:name)
|
21
|
+
@baths = Bath.fetch(options[:name])
|
22
|
+
else
|
23
|
+
@baths = Bath.fetch
|
24
|
+
end
|
25
|
+
end
|
26
|
+
@baths
|
27
|
+
end
|
28
|
+
|
29
|
+
def options
|
30
|
+
if @options.nil?
|
31
|
+
@options = {}
|
32
|
+
OptionParser.new do |opts|
|
33
|
+
opts.banner = "Usage: #{$0} [options]"
|
34
|
+
|
35
|
+
opts.on("-n", "--name NAME", "Specify a bath name or any fragment of it") do |name|
|
36
|
+
options[:name] = name
|
37
|
+
end
|
38
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
39
|
+
puts opts
|
40
|
+
exit
|
41
|
+
end
|
42
|
+
end.parse!
|
43
|
+
end
|
44
|
+
@options
|
45
|
+
end
|
46
|
+
|
47
|
+
def output
|
48
|
+
baths.each do |bath|
|
49
|
+
puts "%-#{max_lengths[:name]}s | %-2s°C | %-#{max_lengths[:open_status]}s | %s" % [
|
50
|
+
bath.name,
|
51
|
+
bath.temperature,
|
52
|
+
bath.open_status,
|
53
|
+
bath.modified_at
|
54
|
+
]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def max_lengths
|
59
|
+
{
|
60
|
+
:name => baths.collect{ |x| x.name }.sort_by(&:length).last.length,
|
61
|
+
:open_status => baths.collect{ |x| x.open_status }.sort_by(&:length).last.length
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# koffeinfrei zueribad-rb
|
4
|
+
# copyright (C) 2011 alexis reigel
|
5
|
+
#
|
6
|
+
# license: gpl v3
|
7
|
+
|
8
|
+
module Zueribad
|
9
|
+
class Bath
|
10
|
+
|
11
|
+
SERVICE_URL = 'http://www.stadt-zuerich.ch/stzh/bathdatadownload'
|
12
|
+
|
13
|
+
attr_accessor :name
|
14
|
+
attr_accessor :temperature
|
15
|
+
attr_accessor :open_status
|
16
|
+
attr_accessor :modified_at
|
17
|
+
|
18
|
+
def initialize(params = {})
|
19
|
+
params.each do |k,v|
|
20
|
+
if respond_to? k
|
21
|
+
instance_variable_set("@#{k}".to_sym, v)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.fetch(name = nil)
|
27
|
+
doc = Nokogiri::Slop(self.download)
|
28
|
+
|
29
|
+
baths = doc.bathinfos.baths.bath.map do |x|
|
30
|
+
Bath.new(:name => x.title.content,
|
31
|
+
:temperature => x.temperatureWater.content,
|
32
|
+
:open_status => x.openClosedTextPlain.content,
|
33
|
+
:modified_at => x.dateModified.content)
|
34
|
+
end
|
35
|
+
|
36
|
+
if name
|
37
|
+
baths.select {|x| x.name =~ /#{name}/i}
|
38
|
+
else
|
39
|
+
baths
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.download
|
44
|
+
open(SERVICE_URL).read
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/zueribad.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# koffeinfrei zueribad-rb
|
4
|
+
# copyright (C) 2011 alexis reigel
|
5
|
+
#
|
6
|
+
# license: gpl v3
|
7
|
+
|
8
|
+
require 'nokogiri'
|
9
|
+
require 'open-uri'
|
10
|
+
require 'optparse'
|
11
|
+
|
12
|
+
require 'zueribad/version'
|
13
|
+
require 'zueribad/bath'
|
14
|
+
require 'zueribad/application'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'zueribad'
|
2
|
+
|
3
|
+
module Zueribad
|
4
|
+
describe Application do
|
5
|
+
context '#options' do
|
6
|
+
context 'no arguments given' do
|
7
|
+
it 'should have default options' do
|
8
|
+
Application.new.options.length.should be == 0
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'name argument given' do
|
13
|
+
it 'should be in options' do
|
14
|
+
ARGV << '-n' << 'letten'
|
15
|
+
Application.new.options[:name].should be == 'letten'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context '#max_lengths' do
|
21
|
+
before do
|
22
|
+
@application = Application.new
|
23
|
+
@application.stub(:baths => ['a', 'abc', 'ab'].map do |x|
|
24
|
+
Bath.new(:name => x, :open_status => x)
|
25
|
+
end)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should return the length of the longest name' do
|
29
|
+
@application.max_lengths[:name].should be == 3
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should return the length of the longest name' do
|
33
|
+
@application.max_lengths[:open_status].should be == 3
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context '#output' do
|
38
|
+
context 'filtered by name' do
|
39
|
+
it 'should put stdout twice' do
|
40
|
+
ARGV << '-n' << 'letten'
|
41
|
+
STDOUT.should_receive(:puts).exactly(2).times
|
42
|
+
Application.new.output
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/bath_spec.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'zueribad'
|
2
|
+
|
3
|
+
module Zueribad
|
4
|
+
describe Bath do
|
5
|
+
|
6
|
+
before do
|
7
|
+
# stub to load xml from fixtures instead of server
|
8
|
+
path = File.join(File.dirname(__FILE__), 'fixtures', 'baths.xml')
|
9
|
+
data = File.read(path)
|
10
|
+
Bath.stub(:download => data)
|
11
|
+
end
|
12
|
+
|
13
|
+
context '#fetch' do
|
14
|
+
context 'no param' do
|
15
|
+
|
16
|
+
before do
|
17
|
+
@baths = Bath.fetch
|
18
|
+
end
|
19
|
+
it 'should return all baths' do
|
20
|
+
@baths.length.should be > 1
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'the first element' do
|
24
|
+
it 'should have a name' do
|
25
|
+
@baths[0].name.should_not be_nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should have a temperature' do
|
29
|
+
@baths[0].temperature.should_not be_nil
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should have a open_status' do
|
33
|
+
@baths[0].open_status.should_not be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should have a modified_at' do
|
37
|
+
@baths[0].modified_at.should_not be_nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'name param given' do
|
43
|
+
it 'should return baths that contain the name' do
|
44
|
+
Bath.fetch('letten').length.should be == 2
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<bathinfos>
|
3
|
+
<baths>
|
4
|
+
<bath>
|
5
|
+
<title>Flussbad Au-Höngg</title>
|
6
|
+
<temperatureWater>18</temperatureWater>
|
7
|
+
<dateModified>Sa, 16.06.2012 14:26</dateModified>
|
8
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
9
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_au_hoengg.html</urlPage>
|
10
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_au_hoengg</pathPage>
|
11
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_au_hoengg/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
12
|
+
</bath>
|
13
|
+
<bath>
|
14
|
+
<title>Flussbad Oberer Letten</title>
|
15
|
+
<temperatureWater>10</temperatureWater>
|
16
|
+
<dateModified>Mo, 14.05.2012 08:48</dateModified>
|
17
|
+
<openClosedTextPlain><![CDATA[Saisonstart 16. Juni 2012]]></openClosedTextPlain>
|
18
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_oberer_letten.html</urlPage>
|
19
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_oberer_letten</pathPage>
|
20
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_oberer_letten/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
21
|
+
</bath>
|
22
|
+
<bath>
|
23
|
+
<title>Flussbad Unterer Letten</title>
|
24
|
+
<temperatureWater>21</temperatureWater>
|
25
|
+
<dateModified>Sa, 16.06.2012 14:18</dateModified>
|
26
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
27
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_unterer_letten.html</urlPage>
|
28
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_unterer_letten</pathPage>
|
29
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/flussbad_unterer_letten/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
30
|
+
</bath>
|
31
|
+
<bath>
|
32
|
+
<title>Frauenbad Stadthausquai</title>
|
33
|
+
<temperatureWater>17</temperatureWater>
|
34
|
+
<dateModified>Sa, 16.06.2012 10:02</dateModified>
|
35
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
36
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/frauenbad_stadthausquai.html</urlPage>
|
37
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/frauenbad_stadthausquai</pathPage>
|
38
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/frauenbad_stadthausquai/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
39
|
+
</bath>
|
40
|
+
<bath>
|
41
|
+
<title>Freibad Allenmoos</title>
|
42
|
+
<temperatureWater>20</temperatureWater>
|
43
|
+
<dateModified>Sa, 16.06.2012 09:50</dateModified>
|
44
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
45
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_allenmoos.html</urlPage>
|
46
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_allenmoos</pathPage>
|
47
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_allenmoos/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
48
|
+
</bath>
|
49
|
+
<bath>
|
50
|
+
<title>Freibad Auhof</title>
|
51
|
+
<temperatureWater>25</temperatureWater>
|
52
|
+
<dateModified>Sa, 16.06.2012 08:38</dateModified>
|
53
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
54
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_auhof.html</urlPage>
|
55
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_auhof</pathPage>
|
56
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_auhof/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
57
|
+
</bath>
|
58
|
+
<bath>
|
59
|
+
<title>Freibad Heuried</title>
|
60
|
+
<temperatureWater>24</temperatureWater>
|
61
|
+
<dateModified>Sa, 16.06.2012 16:14</dateModified>
|
62
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
63
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_heuried.html</urlPage>
|
64
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_heuried</pathPage>
|
65
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_heuried/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
66
|
+
</bath>
|
67
|
+
<bath>
|
68
|
+
<title>Freibad Letzigraben</title>
|
69
|
+
<temperatureWater>23</temperatureWater>
|
70
|
+
<dateModified>Sa, 16.06.2012 08:25</dateModified>
|
71
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
72
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_letzigraben.html</urlPage>
|
73
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_letzigraben</pathPage>
|
74
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_letzigraben/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
75
|
+
</bath>
|
76
|
+
<bath>
|
77
|
+
<title>Freibad Seebach</title>
|
78
|
+
<temperatureWater>26</temperatureWater>
|
79
|
+
<dateModified>Sa, 16.06.2012 12:51</dateModified>
|
80
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
81
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_seebach.html</urlPage>
|
82
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_seebach</pathPage>
|
83
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_seebach/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
84
|
+
</bath>
|
85
|
+
<bath>
|
86
|
+
<title>Freibad Zwischen den Hölzern</title>
|
87
|
+
<temperatureWater>20</temperatureWater>
|
88
|
+
<dateModified>Sa, 16.06.2012 09:12</dateModified>
|
89
|
+
<openClosedTextPlain><![CDATA[geöffnetbis20h]]></openClosedTextPlain>
|
90
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_zwischen_den_hoelzern.html</urlPage>
|
91
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_zwischen_den_hoelzern</pathPage>
|
92
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/freibad_zwischen_den_hoelzern/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
93
|
+
</bath>
|
94
|
+
<bath>
|
95
|
+
<title>Seebad Katzensee</title>
|
96
|
+
<temperatureWater>22</temperatureWater>
|
97
|
+
<dateModified>Sa, 16.06.2012 12:23</dateModified>
|
98
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
99
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_katzensee.html</urlPage>
|
100
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_katzensee</pathPage>
|
101
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_katzensee/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
102
|
+
</bath>
|
103
|
+
<bath>
|
104
|
+
<title>Seebad Utoquai</title>
|
105
|
+
<temperatureWater>19</temperatureWater>
|
106
|
+
<dateModified>Sa, 16.06.2012 06:47</dateModified>
|
107
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
108
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_utoquai.html</urlPage>
|
109
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_utoquai</pathPage>
|
110
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/seebad_utoquai/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
111
|
+
</bath>
|
112
|
+
<bath>
|
113
|
+
<title>Strandbad Mythenquai</title>
|
114
|
+
<temperatureWater>19</temperatureWater>
|
115
|
+
<dateModified>Sa, 16.06.2012 14:10</dateModified>
|
116
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
117
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_mythenquai.html</urlPage>
|
118
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_mythenquai</pathPage>
|
119
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_mythenquai/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
120
|
+
</bath>
|
121
|
+
<bath>
|
122
|
+
<title>Strandbad Tiefenbrunnen</title>
|
123
|
+
<temperatureWater>19</temperatureWater>
|
124
|
+
<dateModified>Sa, 16.06.2012 15:06</dateModified>
|
125
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
126
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_tiefenbrunnen.html</urlPage>
|
127
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_tiefenbrunnen</pathPage>
|
128
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_tiefenbrunnen/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
129
|
+
</bath>
|
130
|
+
<bath>
|
131
|
+
<title>Strandbad Wollishofen </title>
|
132
|
+
<temperatureWater>19</temperatureWater>
|
133
|
+
<dateModified>Sa, 16.06.2012 08:40</dateModified>
|
134
|
+
<openClosedTextPlain><![CDATA[geöffnet]]></openClosedTextPlain>
|
135
|
+
<urlPage>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_wollishofen.html</urlPage>
|
136
|
+
<pathPage>/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_wollishofen</pathPage>
|
137
|
+
<urlAddressAndOpeningHours>http://www.stadt-zuerich.ch/content/ssd/de/index/sport/schwimmen/sommerbaeder/strandbad_wollishofen/adresse/jcr:content/contenttabparsys/_ffnungszeiten.html</urlAddressAndOpeningHours>
|
138
|
+
</bath>
|
139
|
+
</baths>
|
140
|
+
<meta>
|
141
|
+
<dateformat>EE, dd.MM.yyyy HH:mm</dateformat>
|
142
|
+
<uvindexValue>8</uvindexValue>
|
143
|
+
<uvindexImgUrl>http://www.stadt-zuerich.ch/apps/stzh/statics/media/uvindex/uvindex_08.gif</uvindexImgUrl>
|
144
|
+
<uvindexImgPath>/apps/stzh/statics/media/uvindex/uvindex_08.gif</uvindexImgPath>
|
145
|
+
<uvindexLegalText>Quelle: MeteoSchweiz</uvindexLegalText>
|
146
|
+
<uvindexImgLinkPath>/ssd/de/index/sport/schwimmen/uv_schutz.html</uvindexImgLinkPath>
|
147
|
+
<urlLegal>http://www.stadt-zuerich.ch/portal/de/index/footer/rechtliche_hinweise.html</urlLegal>
|
148
|
+
<dateTimeSent>Sa, 16.06.2012 17:00</dateTimeSent>
|
149
|
+
<dateTimeLastModified>Sa, 16.06.2012 16:14</dateTimeLastModified>
|
150
|
+
<orderedBy>
|
151
|
+
<property>{page}jcr:content/navTitle</property>
|
152
|
+
<mode>ascending</mode>
|
153
|
+
</orderedBy>
|
154
|
+
</meta>
|
155
|
+
</bathinfos>
|
data/zueribad.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/zueribad/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["koffeinfrei"]
|
6
|
+
gem.email = ["mail@koffeinfrei.org"]
|
7
|
+
gem.description = %q{displays the temperature and additional information about all municipal baths in zurich}
|
8
|
+
gem.summary = %q{cli for the zueribad api}
|
9
|
+
gem.homepage = "https://github.com/koffeinfrei/zueribad-rb"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "zueribad"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Zueribad::VERSION
|
17
|
+
|
18
|
+
gem.add_runtime_dependency 'nokogiri'
|
19
|
+
|
20
|
+
gem.add_development_dependency 'rake'
|
21
|
+
gem.add_development_dependency 'rspec'
|
22
|
+
gem.add_development_dependency 'nyan-cat-formatter'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zueribad
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- koffeinfrei
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
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: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: nyan-cat-formatter
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: displays the temperature and additional information about all municipal
|
79
|
+
baths in zurich
|
80
|
+
email:
|
81
|
+
- mail@koffeinfrei.org
|
82
|
+
executables:
|
83
|
+
- zueribad
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
87
|
+
- .gitignore
|
88
|
+
- .rspec
|
89
|
+
- .rvmrc
|
90
|
+
- Gemfile
|
91
|
+
- LICENSE
|
92
|
+
- README.md
|
93
|
+
- Rakefile
|
94
|
+
- bin/zueribad
|
95
|
+
- lib/zueribad.rb
|
96
|
+
- lib/zueribad/application.rb
|
97
|
+
- lib/zueribad/bath.rb
|
98
|
+
- lib/zueribad/version.rb
|
99
|
+
- spec/application_spec.rb
|
100
|
+
- spec/bath_spec.rb
|
101
|
+
- spec/fixtures/baths.xml
|
102
|
+
- zueribad.gemspec
|
103
|
+
homepage: https://github.com/koffeinfrei/zueribad-rb
|
104
|
+
licenses: []
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
hash: -2334434366920446854
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
segments:
|
125
|
+
- 0
|
126
|
+
hash: -2334434366920446854
|
127
|
+
requirements: []
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 1.8.24
|
130
|
+
signing_key:
|
131
|
+
specification_version: 3
|
132
|
+
summary: cli for the zueribad api
|
133
|
+
test_files:
|
134
|
+
- spec/application_spec.rb
|
135
|
+
- spec/bath_spec.rb
|
136
|
+
- spec/fixtures/baths.xml
|