whatson 1.0.0 → 2023.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Manifest.txt +5 -0
- data/README.md +120 -8
- data/Rakefile +11 -2
- data/bin/beerfest +1 -2
- data/bin/kickoff +1 -2
- data/bin/pycon +17 -0
- data/bin/rubyconf +1 -1
- data/bin/whatson +17 -0
- data/lib/whatson/beerfest.rb +8 -36
- data/lib/whatson/football.rb +9 -36
- data/lib/whatson/pycon.rb +19 -0
- data/lib/whatson/rubyconf.rb +9 -35
- data/lib/whatson/tool.rb +82 -0
- data/lib/whatson/version.rb +3 -4
- data/lib/whatson/whatson.rb +20 -0
- data/lib/whatson.rb +8 -10
- data/test/helper.rb +2 -0
- data/test/test_beerfest.rb +4 -4
- data/test/test_kickoff.rb +4 -4
- data/test/test_rubyconf.rb +4 -6
- metadata +26 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 34180257ba9f77bdcc43329af131cba9535e9249460c195ac0e62a5378ef61a1
|
4
|
+
data.tar.gz: 9934a0cd6136f1e58dae65b6bf06248c1314d6ef3008073306645596fa967897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9585fd8f499ec6aee15e569f53d8ac89750d47f44564e79c061bd572444fa63da786eb9dcef0f958c20aa359f4099b2c9cebf30053c09964890450bbfd8f2bb
|
7
|
+
data.tar.gz: d835d3206f16221a6d5d13fec923fe08604aeee4f218dcd5cb1141215b9880324305c9cfef20a982dec4b3df521807c1a158038aa12a97575648b57455b382ef
|
data/Manifest.txt
CHANGED
@@ -4,12 +4,17 @@ README.md
|
|
4
4
|
Rakefile
|
5
5
|
bin/beerfest
|
6
6
|
bin/kickoff
|
7
|
+
bin/pycon
|
7
8
|
bin/rubyconf
|
9
|
+
bin/whatson
|
8
10
|
lib/whatson.rb
|
9
11
|
lib/whatson/beerfest.rb
|
10
12
|
lib/whatson/football.rb
|
13
|
+
lib/whatson/pycon.rb
|
11
14
|
lib/whatson/rubyconf.rb
|
15
|
+
lib/whatson/tool.rb
|
12
16
|
lib/whatson/version.rb
|
17
|
+
lib/whatson/whatson.rb
|
13
18
|
test/helper.rb
|
14
19
|
test/test_beerfest.rb
|
15
20
|
test/test_kickoff.rb
|
data/README.md
CHANGED
@@ -9,14 +9,11 @@ what's on now command line tool (using the event.db machinery)
|
|
9
9
|
* forum :: [ruby-talk@ruby-lang.org](http://www.ruby-lang.org/en/community/mailing-lists)
|
10
10
|
|
11
11
|
|
12
|
-
## Command
|
12
|
+
## Command Line Tools - `rubyconf`, `pycon`, `kickoff`, `beerfest`
|
13
13
|
|
14
|
-
The whatson
|
15
|
-
to list upcoming events (ruby conferences,
|
16
|
-
|
17
|
-
[Upcoming Ruby Conferences](#upcoming-ruby-conferences) •
|
18
|
-
[Upcoming Football Tournaments](#upcoming-football-tournaments) •
|
19
|
-
[Upcoming Beerfests](#upcoming-beerfests)
|
14
|
+
The whatson package includes command line tools
|
15
|
+
to list upcoming events (ruby conferences, python conferences,
|
16
|
+
football tournaments, beer festivals. etc.).
|
20
17
|
|
21
18
|
|
22
19
|
### Upcoming Ruby Conferences
|
@@ -27,7 +24,20 @@ Use
|
|
27
24
|
$ rubyconf
|
28
25
|
```
|
29
26
|
|
30
|
-
to list upcoming Ruby (un)conferences from around the world. Will print in
|
27
|
+
to list upcoming Ruby (un)conferences from around the world. Will print in 2023:
|
28
|
+
|
29
|
+
```
|
30
|
+
Upcoming Ruby Conferences:
|
31
|
+
|
32
|
+
in 33d RubyConf Australia, Mon+Tue Feb/20+21 (2d) @ Melbourne, Australia
|
33
|
+
in 96d RailsConf (United States), Mon-Wed Apr/24-26 (3d) @ Atlanta, Georgia, United States
|
34
|
+
in 113d RubyKaigi, Thu-Sat May/11-13 (3d) @ Nagano, Japan
|
35
|
+
in 162d Punk's Not Dead Conf - Ruby (Pixel) Art Programming, Thu+Fri Jun/29+30 (2d) @ Vienna, Austria
|
36
|
+
...
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
and back in 2020:
|
31
41
|
|
32
42
|
```
|
33
43
|
Upcoming Ruby Conferences:
|
@@ -74,6 +84,34 @@ Upcoming Ruby Conferences:
|
|
74
84
|
|
75
85
|
|
76
86
|
|
87
|
+
### Upcoming Python Conferences
|
88
|
+
|
89
|
+
Use
|
90
|
+
|
91
|
+
```
|
92
|
+
$ pycon
|
93
|
+
```
|
94
|
+
|
95
|
+
to list upcoming Python (un)conferences from around the world. Will print in 2020:
|
96
|
+
|
97
|
+
```
|
98
|
+
Upcoming Python Conferences:
|
99
|
+
|
100
|
+
in 62d PyCascades, Sat+Sun Feb/8+9 (2d) @ Portland, Oregon, United States
|
101
|
+
in 72d PyCon Namibia, Tue-Thu Feb/18-20 (3d) @ Windhoek, Namibia
|
102
|
+
in 90d PyTennessee, Sat+Sun Mar/7+8 (2d) @ Nashville, Tennessee, United States
|
103
|
+
in 110d Moscow Python Conf, Fri Mar/27 (1d) @ Moscow, Russia
|
104
|
+
in 116d PyCon Italy, Thu-Sun Apr/2-5 (4d) @ Florence, Italy
|
105
|
+
in 129d PyCon US, Wed-Thu Apr/15-23 (9d) @ Pittsburgh, Pennsylvania, United States
|
106
|
+
in 160d PyTexas, Sat+Sun May/16+17 (2d) @ Austin, Texas, United States
|
107
|
+
in 225d EuroPython, Mon-Sun Jul/20-26 (7d) @ Dublin, Ireland
|
108
|
+
in 230d PyOhio, Sat+Sun Jul/25+26 (2d) @ Columbus, Ohio, United States
|
109
|
+
in 232d EuroSciPy, Mon-Fri Jul/27-31 (5d) @ Bilbao, Spain
|
110
|
+
in 232d GeoPython, Mon-Fri Jul/27-31 (5d) @ Bilbao, Spain
|
111
|
+
in 311d PyConDE & PyData Berlin, Wed-Fri Oct/14-16 (3d) @ Berlin, Germany
|
112
|
+
```
|
113
|
+
|
114
|
+
|
77
115
|
### Upcoming Football Tournaments
|
78
116
|
|
79
117
|
Use
|
@@ -122,6 +160,79 @@ Upcoming Beerfests:
|
|
122
160
|
|
123
161
|
|
124
162
|
|
163
|
+
## Do-It-Yourself (DIY) - Use Your Own Event Datasets
|
164
|
+
|
165
|
+
Note: You can pass in local or remote datafiles in the markdown, yaml or csv formats
|
166
|
+
instead of using the built-in / pre-configured datafiles.
|
167
|
+
Example:
|
168
|
+
|
169
|
+
```
|
170
|
+
$ rubyconf https://github.com/planetruby/calendar/raw/master/_data/conferences2023.yml
|
171
|
+
# - or -
|
172
|
+
$ rubyconf conferences2023.yml # note: assumes a saved (local) copy in the working dir (./)
|
173
|
+
|
174
|
+
$ pycon https://github.com/python-organizers/conferences/raw/master/2023.csv
|
175
|
+
# - or
|
176
|
+
$ pycon 2023.csv # note: assumes a saved (local) copy in the working dir (./)
|
177
|
+
|
178
|
+
$ kickoff https://github.com/footballbook/calendar/raw/master/README.md
|
179
|
+
# - or -
|
180
|
+
$ kickoff README.md # note: assumes a saved (local) copy in the working dir (./)
|
181
|
+
```
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
## `whatson` Command Line Tool
|
186
|
+
|
187
|
+
Use the `whatson` command line tool as a "generic catch-all" to print any type of event.
|
188
|
+
Example:
|
189
|
+
|
190
|
+
```
|
191
|
+
$ whatson https://github.com/planetruby/calendar/raw/master/_data/conferences2023.yml \
|
192
|
+
https://github.com/python-organizers/conferences/raw/master/2023.csv
|
193
|
+
```
|
194
|
+
|
195
|
+
Note: `whatson` is pre-configured (that is, if you do not pass along any datafiles)
|
196
|
+
to print ongoing and upcoming ruby and python conferences.
|
197
|
+
|
198
|
+
For easy (re)use you can write all datafiles in a text file and pass along the
|
199
|
+
text file. Example - `conf.txt`:
|
200
|
+
|
201
|
+
```
|
202
|
+
########################################
|
203
|
+
# conf.txt - What's On Datafiles
|
204
|
+
|
205
|
+
https://github.com/planetruby/calendar/raw/master/_data/conferences2023.yml
|
206
|
+
https://github.com/python-organizers/conferences/raw/master/2023.csv
|
207
|
+
```
|
208
|
+
|
209
|
+
And pass along to `whatson`. Example:
|
210
|
+
|
211
|
+
```
|
212
|
+
$ whatson conf.txt
|
213
|
+
```
|
214
|
+
|
215
|
+
|
216
|
+
Resulting back in 2020:
|
217
|
+
|
218
|
+
```
|
219
|
+
reading >conf.txt<...
|
220
|
+
reading >https://github.com/planetruby/calendar/raw/master/_data/conferences2020.yml<...
|
221
|
+
reading >https://github.com/python-organizers/conferences/raw/master/2020.csv<...
|
222
|
+
|
223
|
+
|
224
|
+
Upcoming Events:
|
225
|
+
|
226
|
+
in 60d Rubyfuza, Thu-Sat Feb/6-8 (3d) @ Cape Town, South Africa
|
227
|
+
in 62d PyCascades, Sat+Sun Feb/8+9 (2d) @ Portland, Oregon, United States
|
228
|
+
in 72d ParisRB Conf, Tue+Wed Feb/18+19 (2d) @ Paris, France
|
229
|
+
in 72d PyCon Namibia, Tue-Thu Feb/18-20 (3d) @ Windhoek, Namibia
|
230
|
+
...
|
231
|
+
```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
125
236
|
## Public Event Datasets
|
126
237
|
|
127
238
|
- [Calendar @ Planet Ruby](https://github.com/planetruby/calendar) - a collection of awesome Ruby events (meetups, conferences, camps, etc.) from around the world
|
@@ -130,6 +241,7 @@ Upcoming Beerfests:
|
|
130
241
|
|
131
242
|
|
132
243
|
|
244
|
+
|
133
245
|
## Install
|
134
246
|
|
135
247
|
Just install the gem:
|
data/Rakefile
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require 'hoe'
|
2
2
|
require './lib/whatson/version.rb'
|
3
3
|
|
4
|
+
|
5
|
+
###
|
6
|
+
# hack/ quick fix for broken intuit_values - overwrite with dummy
|
7
|
+
class Hoe
|
8
|
+
def intuit_values( input ); end
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
|
4
13
|
Hoe.spec 'whatson' do
|
5
14
|
|
6
15
|
self.version = WhatsOn::VERSION
|
@@ -8,7 +17,7 @@ Hoe.spec 'whatson' do
|
|
8
17
|
self.summary = "whatson - what's on now command line tool (using the event.db machinery)"
|
9
18
|
self.description = summary
|
10
19
|
|
11
|
-
self.urls =
|
20
|
+
self.urls = { home: 'https://github.com/rubycocos/events' }
|
12
21
|
|
13
22
|
self.author = 'Gerald Bauer'
|
14
23
|
self.email = 'ruby-talk@ruby-lang.org'
|
@@ -18,7 +27,7 @@ Hoe.spec 'whatson' do
|
|
18
27
|
self.history_file = 'CHANGELOG.md'
|
19
28
|
|
20
29
|
self.extra_deps = [
|
21
|
-
['eventdb', '>= 1.
|
30
|
+
['eventdb', '>= 1.1.1'],
|
22
31
|
## 3rd party
|
23
32
|
['fetcher', '>= 0.4.5'],
|
24
33
|
['sqlite3']
|
data/bin/beerfest
CHANGED
data/bin/kickoff
CHANGED
data/bin/pycon
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
###################
|
4
|
+
# == DEV TIPS:
|
5
|
+
#
|
6
|
+
# For local testing run like:
|
7
|
+
#
|
8
|
+
# ruby -Ilib bin/pycon
|
9
|
+
#
|
10
|
+
# Set the executable bit in Linux. Example:
|
11
|
+
#
|
12
|
+
# % chmod a+x bin/pycon
|
13
|
+
#
|
14
|
+
|
15
|
+
require 'whatson'
|
16
|
+
|
17
|
+
WhatsOn::PyCon.main
|
data/bin/rubyconf
CHANGED
data/bin/whatson
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
###################
|
4
|
+
# == DEV TIPS:
|
5
|
+
#
|
6
|
+
# For local testing run like:
|
7
|
+
#
|
8
|
+
# ruby -Ilib bin/whatson
|
9
|
+
#
|
10
|
+
# Set the executable bit in Linux. Example:
|
11
|
+
#
|
12
|
+
# % chmod a+x bin/whatson
|
13
|
+
#
|
14
|
+
|
15
|
+
require 'whatson'
|
16
|
+
|
17
|
+
WhatsOn::WhatsOn.main
|
data/lib/whatson/beerfest.rb
CHANGED
@@ -1,47 +1,19 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
|
3
2
|
module WhatsOn
|
4
3
|
|
5
|
-
class BeerFest
|
4
|
+
class BeerFest < Tool
|
6
5
|
|
7
|
-
def
|
8
|
-
## turn down logger (default :debug?)
|
9
|
-
LogUtils::Logger.root.level = :info
|
6
|
+
def self.main() new( ARGV ).list; end
|
10
7
|
|
11
|
-
@db = EventDb::Memory.new ## note: use in-memory SQLite database
|
12
|
-
@db.read( "https://github.com/beerbook/calendar/raw/master/README.md" )
|
13
|
-
end
|
14
|
-
|
15
|
-
def print
|
16
|
-
## get next 17 events
|
17
|
-
|
18
|
-
today = Date.today
|
19
|
-
|
20
|
-
up = EventDb::Model::Event.limit( 17 ).upcoming( today )
|
21
8
|
|
22
|
-
|
23
|
-
|
9
|
+
def initialize( args=ARGV )
|
10
|
+
args = ['https://github.com/beerbook/calendar/raw/master/README.md'] if args.empty?
|
24
11
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
on = EventDb::Model::Event.live( today )
|
31
|
-
on.each do |e|
|
32
|
-
puts " NOW ON #{e.current_day(today)}d #{e.title}, #{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
33
|
-
end
|
34
|
-
|
35
|
-
puts '' if on.any?
|
36
|
-
|
37
|
-
up.each do |e|
|
38
|
-
puts " in #{e.diff_days(today)}d #{e.title}, #{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
39
|
-
end
|
40
|
-
puts ''
|
41
|
-
puts " More @ github.com/beerbook/calendar"
|
42
|
-
puts ''
|
12
|
+
super( args,
|
13
|
+
title: 'Upcoming Beerfests',
|
14
|
+
more_link: 'github.com/beerbook/calendar'
|
15
|
+
)
|
43
16
|
end
|
44
|
-
|
45
17
|
end # class BeerFest
|
46
18
|
|
47
19
|
end # module WhatsOn
|
data/lib/whatson/football.rb
CHANGED
@@ -1,47 +1,20 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
|
3
2
|
module WhatsOn
|
4
3
|
|
5
|
-
class Football
|
4
|
+
class Football < Tool
|
6
5
|
|
7
|
-
def
|
8
|
-
## turn down logger (default :debug?)
|
9
|
-
LogUtils::Logger.root.level = :info
|
6
|
+
def self.main() new( ARGV ).list; end
|
10
7
|
|
11
|
-
@db = EventDb::Memory.new ## note: use in-memory SQLite database
|
12
|
-
@db.read( "https://github.com/footballbook/calendar/raw/master/README.md" )
|
13
|
-
end
|
14
|
-
|
15
|
-
def print
|
16
|
-
## get next 17 events
|
17
|
-
|
18
|
-
today = Date.today
|
19
|
-
|
20
|
-
up = EventDb::Model::Event.limit( 17 ).upcoming( today )
|
21
|
-
## pp up.to_sql
|
22
|
-
## pp up
|
23
8
|
|
9
|
+
def initialize( args=ARGV )
|
10
|
+
args = ['https://github.com/footballbook/calendar/raw/master/README.md'] if args.empty?
|
24
11
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
on = EventDb::Model::Event.live( today )
|
31
|
-
on.each do |e|
|
32
|
-
puts " NOW ON #{e.current_day(today)}d #{e.title} #{e.start_date.year}, #{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
33
|
-
end
|
34
|
-
|
35
|
-
puts '' if on.any?
|
36
|
-
|
37
|
-
up.each do |e|
|
38
|
-
puts " in #{e.diff_days(today)}d #{e.title} #{e.start_date.year}, #{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
39
|
-
end
|
40
|
-
puts ''
|
41
|
-
puts " More @ github.com/footballbook/calendar"
|
42
|
-
puts ''
|
12
|
+
super( args,
|
13
|
+
title: 'Upcoming Football Tournaments',
|
14
|
+
more_link: 'github.com/footballbook/calendar',
|
15
|
+
show_year: true ## e.g. World Cup 2020 etc.
|
16
|
+
)
|
43
17
|
end
|
44
|
-
|
45
18
|
end # class Football
|
46
19
|
|
47
20
|
end # module WhatsOn
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
module WhatsOn
|
3
|
+
|
4
|
+
class PyCon < Tool
|
5
|
+
|
6
|
+
def self.main() new( ARGV ).list; end
|
7
|
+
|
8
|
+
|
9
|
+
def initialize( args=ARGV )
|
10
|
+
args = ['https://github.com/python-organizers/conferences/raw/main/2023.csv'] if args.empty?
|
11
|
+
|
12
|
+
super( args,
|
13
|
+
title: 'Upcoming Python Conferences',
|
14
|
+
more_link: 'github.com/python-organizers/conferences'
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end # class PyCon
|
18
|
+
|
19
|
+
end # module WhatsOn
|
data/lib/whatson/rubyconf.rb
CHANGED
@@ -1,46 +1,20 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
|
3
|
-
module WhatsOn
|
4
|
-
|
5
|
-
class RubyConf
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
## turn down logger (default :debug?)
|
9
|
-
LogUtils::Logger.root.level = :info
|
10
|
-
|
11
|
-
@db = EventDb::Memory.new ## note: use in-memory SQLite database
|
12
|
-
@db.read( "https://github.com/planetruby/calendar/raw/master/_data/conferences2020.yml" )
|
13
|
-
end
|
14
|
-
|
15
|
-
def print
|
16
|
-
## get next 17 events
|
17
2
|
|
18
|
-
|
3
|
+
module WhatsOn
|
19
4
|
|
20
|
-
|
21
|
-
## pp up.to_sql
|
22
|
-
## pp up
|
5
|
+
class RubyConf < Tool
|
23
6
|
|
24
|
-
|
25
|
-
puts ''
|
26
|
-
puts "Upcoming Ruby Conferences:"
|
27
|
-
puts ''
|
7
|
+
def self.main() new( ARGV ).list; end
|
28
8
|
|
29
|
-
on = EventDb::Model::Event.live( today )
|
30
|
-
on.each do |e|
|
31
|
-
puts " NOW ON #{e.current_day(today)}d #{e.title}, #{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
32
|
-
end
|
33
9
|
|
34
|
-
|
10
|
+
def initialize( args=ARGV )
|
11
|
+
args = ['https://github.com/planetruby/conferences/raw/master/_data/conferences2023.yml'] if args.empty?
|
35
12
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
puts " More @ github.com/planetruby/calendar"
|
41
|
-
puts ''
|
13
|
+
super( args,
|
14
|
+
title: 'Upcoming Ruby Conferences',
|
15
|
+
more_link: 'github.com/planetruby/calendar'
|
16
|
+
)
|
42
17
|
end
|
43
|
-
|
44
18
|
end # class RubyConf
|
45
19
|
|
46
20
|
end # module WhatsOn
|
data/lib/whatson/tool.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
module WhatsOn
|
3
|
+
|
4
|
+
|
5
|
+
## base (shared) tool class
|
6
|
+
class Tool
|
7
|
+
|
8
|
+
## todo/fix: use header, footer instead of title, more_link - why? why not?
|
9
|
+
|
10
|
+
Config = Struct.new( :title, ## todo/change: find better names for config params - why? why not?
|
11
|
+
:more_link,
|
12
|
+
:show_year )
|
13
|
+
|
14
|
+
def initialize( args=ARGV,
|
15
|
+
title: 'Upcoming Events',
|
16
|
+
more_link: nil,
|
17
|
+
show_year: false
|
18
|
+
)
|
19
|
+
## turn down logger (default :debug?)
|
20
|
+
LogUtils::Logger.root.level = :info
|
21
|
+
|
22
|
+
@config = Config.new( title,
|
23
|
+
more_link,
|
24
|
+
show_year )
|
25
|
+
|
26
|
+
@db = EventDb::Memory.new ## note: use in-memory SQLite database
|
27
|
+
args.each do |arg|
|
28
|
+
puts " reading >#{arg}<..."
|
29
|
+
@db.read( arg )
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def list ## note: use list and NOT print (otherwise built-in call to print is recursive and will crash!!!)
|
35
|
+
today = Date.today
|
36
|
+
|
37
|
+
puts ''
|
38
|
+
puts ''
|
39
|
+
puts "#{@config.title}:"
|
40
|
+
puts ''
|
41
|
+
|
42
|
+
on = EventDb::Model::Event.live( today )
|
43
|
+
on.each do |e|
|
44
|
+
print " NOW ON #{e.current_day(today)}d "
|
45
|
+
print "#{e.title}"
|
46
|
+
print " #{e.start_date.year}" if @config.show_year
|
47
|
+
print ", "
|
48
|
+
print "#{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
49
|
+
print "\n"
|
50
|
+
end
|
51
|
+
|
52
|
+
puts '' if on.any?
|
53
|
+
|
54
|
+
## get next 17 events
|
55
|
+
up = EventDb::Model::Event.limit( 17 ).upcoming( today )
|
56
|
+
## pp up.to_sql
|
57
|
+
## pp up
|
58
|
+
|
59
|
+
if up.count > 0
|
60
|
+
up.each do |e|
|
61
|
+
print " in #{e.diff_days(today)}d "
|
62
|
+
print "#{e.title}"
|
63
|
+
print " #{e.start_date.year}" if @config.show_year
|
64
|
+
print ", "
|
65
|
+
print "#{e.date_fmt} (#{e.days}d) @ #{e.place}"
|
66
|
+
print "\n"
|
67
|
+
end
|
68
|
+
else
|
69
|
+
puts " -- No upcoming events found. #{EventDb::Model::Event.count} past event(s) in database. --"
|
70
|
+
end
|
71
|
+
|
72
|
+
puts ''
|
73
|
+
|
74
|
+
if @config.more_link
|
75
|
+
puts " More @ #{@config.more_link}"
|
76
|
+
puts ''
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end # class Tool
|
81
|
+
|
82
|
+
end # module WhatsOn
|
data/lib/whatson/version.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
|
3
2
|
module WhatsOn
|
4
3
|
|
5
|
-
MAJOR =
|
4
|
+
MAJOR = 2023 ## todo: namespace inside version or something - why? why not??
|
6
5
|
MINOR = 0
|
7
6
|
PATCH = 0
|
8
7
|
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
@@ -12,11 +11,11 @@ module WhatsOn
|
|
12
11
|
end
|
13
12
|
|
14
13
|
def self.banner
|
15
|
-
"whatson/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
14
|
+
"whatson/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
|
16
15
|
end
|
17
16
|
|
18
17
|
def self.root
|
19
|
-
|
18
|
+
File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
|
20
19
|
end
|
21
20
|
|
22
21
|
end # module WhatsOn
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
module WhatsOn
|
3
|
+
|
4
|
+
class WhatsOn < Tool
|
5
|
+
|
6
|
+
def self.main() new( ARGV ).list; end
|
7
|
+
|
8
|
+
|
9
|
+
def initialize( args=ARGV )
|
10
|
+
args = ['https://github.com/planetruby/conferences/raw/master/_data/conferences2023.yml',
|
11
|
+
'https://github.com/python-organizers/conferences/raw/main/2023.csv',
|
12
|
+
] if args.empty?
|
13
|
+
|
14
|
+
super( args,
|
15
|
+
title: 'Upcoming Events',
|
16
|
+
more_link: 'github.com/rubycocos/events/tree/master/whatson#public-event-datasets'
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end # class WhatsOn
|
20
|
+
end # module WhatsOn
|
data/lib/whatson.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
1
|
# 3rd party libs (gems)
|
5
2
|
require 'eventdb'
|
6
3
|
require 'fetcher'
|
@@ -8,17 +5,18 @@ require 'fetcher'
|
|
8
5
|
|
9
6
|
# our own code
|
10
7
|
|
11
|
-
|
8
|
+
require_relative 'whatson/version' ## let version always go first
|
12
9
|
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
require_relative 'whatson/tool'
|
12
|
+
require_relative 'whatson/beerfest' ## used by beerfest bin(ary) tool
|
13
|
+
require_relative 'whatson/pycon' ## used by pyocn bin(ary) tool
|
14
|
+
require_relative 'whatson/rubyconf' ## used by rubyconf bin(ary) tool
|
15
|
+
require_relative 'whatson/football' ## used by kickoff bin(ary) tool
|
16
|
+
require_relative 'whatson/whatson' ## used by whatson bin(ary) tool
|
18
17
|
|
19
18
|
|
20
19
|
|
21
20
|
|
22
21
|
# say hello
|
23
|
-
puts WhatsOn.banner if defined?($
|
24
|
-
|
22
|
+
puts WhatsOn.banner if defined?($RUBYCOCOS_DEBUG) && $RUBYCOCOS_DEBUG
|
data/test/helper.rb
CHANGED
data/test/test_beerfest.rb
CHANGED
@@ -9,11 +9,11 @@ require 'helper'
|
|
9
9
|
|
10
10
|
class TestBeerFest < MiniTest::Test
|
11
11
|
|
12
|
-
def
|
12
|
+
def test_list
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
whatson = WhatsOn::BeerFest.new
|
15
|
+
whatson.list
|
16
|
+
whatson.list
|
17
17
|
|
18
18
|
assert true # assume ok if we get here
|
19
19
|
end
|
data/test/test_kickoff.rb
CHANGED
@@ -9,11 +9,11 @@ require 'helper'
|
|
9
9
|
|
10
10
|
class TestKickOff < MiniTest::Test
|
11
11
|
|
12
|
-
def
|
12
|
+
def test_list
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
whatson = WhatsOn::Football.new
|
15
|
+
whatson.list
|
16
|
+
whatson.list
|
17
17
|
|
18
18
|
assert true # assume ok if we get here
|
19
19
|
end
|
data/test/test_rubyconf.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
###
|
4
2
|
# to run use
|
5
3
|
# ruby -I ./lib -I ./test test/test_rubyconf.rb
|
@@ -9,11 +7,11 @@ require 'helper'
|
|
9
7
|
|
10
8
|
class TestRubyConf < MiniTest::Test
|
11
9
|
|
12
|
-
def
|
10
|
+
def test_list
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
whatson = WhatsOn::RubyConf.new
|
13
|
+
whatson.list
|
14
|
+
whatson.list
|
17
15
|
|
18
16
|
assert true # assume ok if we get here
|
19
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2023.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventdb
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fetcher
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,36 +56,44 @@ dependencies:
|
|
56
56
|
name: rdoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '4.0'
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '7'
|
62
65
|
type: :development
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
|
-
- - "
|
69
|
+
- - ">="
|
67
70
|
- !ruby/object:Gem::Version
|
68
71
|
version: '4.0'
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '7'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: hoe
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
81
|
+
version: '3.23'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
88
|
+
version: '3.23'
|
83
89
|
description: whatson - what's on now command line tool (using the event.db machinery)
|
84
90
|
email: ruby-talk@ruby-lang.org
|
85
91
|
executables:
|
86
92
|
- beerfest
|
87
93
|
- kickoff
|
94
|
+
- pycon
|
88
95
|
- rubyconf
|
96
|
+
- whatson
|
89
97
|
extensions: []
|
90
98
|
extra_rdoc_files:
|
91
99
|
- CHANGELOG.md
|
@@ -98,21 +106,26 @@ files:
|
|
98
106
|
- Rakefile
|
99
107
|
- bin/beerfest
|
100
108
|
- bin/kickoff
|
109
|
+
- bin/pycon
|
101
110
|
- bin/rubyconf
|
111
|
+
- bin/whatson
|
102
112
|
- lib/whatson.rb
|
103
113
|
- lib/whatson/beerfest.rb
|
104
114
|
- lib/whatson/football.rb
|
115
|
+
- lib/whatson/pycon.rb
|
105
116
|
- lib/whatson/rubyconf.rb
|
117
|
+
- lib/whatson/tool.rb
|
106
118
|
- lib/whatson/version.rb
|
119
|
+
- lib/whatson/whatson.rb
|
107
120
|
- test/helper.rb
|
108
121
|
- test/test_beerfest.rb
|
109
122
|
- test/test_kickoff.rb
|
110
123
|
- test/test_rubyconf.rb
|
111
|
-
homepage: https://github.com/
|
124
|
+
homepage: https://github.com/rubycocos/events
|
112
125
|
licenses:
|
113
126
|
- Public Domain
|
114
127
|
metadata: {}
|
115
|
-
post_install_message:
|
128
|
+
post_install_message:
|
116
129
|
rdoc_options:
|
117
130
|
- "--main"
|
118
131
|
- README.md
|
@@ -129,9 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
142
|
- !ruby/object:Gem::Version
|
130
143
|
version: '0'
|
131
144
|
requirements: []
|
132
|
-
|
133
|
-
|
134
|
-
signing_key:
|
145
|
+
rubygems_version: 3.3.7
|
146
|
+
signing_key:
|
135
147
|
specification_version: 4
|
136
148
|
summary: whatson - what's on now command line tool (using the event.db machinery)
|
137
149
|
test_files: []
|