whatson 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0c2c41be502fe9fba8b1b581877215d3154d586
4
- data.tar.gz: 21e9dddf9ab0f2aa9afd712f0a74d49b7226d762
3
+ metadata.gz: f08817e20cbfaab69ab8df407b36f6b975b26b12
4
+ data.tar.gz: 47e346ad5d22f9abeda90148f3c25b163ef406fd
5
5
  SHA512:
6
- metadata.gz: 59e5ef44aaf67a19f947e623e3b51a8b7ec9796bb269d2db460bfa702365befef8e6471fe60be670a98e50db1ab0635e673b5e64ea24d234ddcdec42f8e089bd
7
- data.tar.gz: 760fec465fe55dbc00728bf1e581bfc74edb206557ef75e5002524c44c2a917e9c3101beeb04a6df925655f451e7f6c787ab28725809ae4c2ef47ec09f07ea9f
6
+ metadata.gz: edf8e3775ad4cda9c8b73c5471551365d89296e567f72c1c45c10c2c42b30b1e9faa2eaa28cb7abc70117c7a8d7f2f3ffab04e8d201b84251de5344acecab4c5
7
+ data.tar.gz: a2f592291710ced7afb31f215bf52b84620d49aeb9123bf3d7517ace06bcc2a2998b40ad136d29f325290e65f7e085ba551dc781ae55caa9248cdeb6eb37a4fd
File without changes
@@ -2,5 +2,13 @@ HISTORY.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
+ bin/beerfest
6
+ bin/kickoff
7
+ bin/rubyconf
5
8
  lib/whatson.rb
9
+ lib/whatson/beerfest.rb
10
+ lib/whatson/football.rb
11
+ lib/whatson/rubyconf.rb
6
12
  lib/whatson/version.rb
13
+ test/helper.rb
14
+ test/test_rubyconf.rb
data/README.md CHANGED
@@ -9,9 +9,97 @@ 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
- ## Usage
12
+ ## Command-Line Tools
13
13
 
14
- to be done
14
+ The whatson gem includes command-line tools
15
+ to list upcoming events (ruby conferences, football tournaments, beer festivals. etc.).
16
+
17
+
18
+ ### Upcoming Ruby Conferences
19
+
20
+ Use
21
+
22
+ ~~~
23
+ $ rubyconf
24
+ ~~~
25
+
26
+ to list upcoming Ruby (un)conferences from around the world. Will print:
27
+
28
+ ~~~
29
+ Upcoming Ruby Conferences:
30
+
31
+ in 8d RubyMotion Conference - #inspect, Wed+Thu Jul/1+2 (2d) @ Paris, France › Europe
32
+ in 27d Brighton Ruby Conference, Mon Jul/20 (1d) @ Brighton, East Sussex › England (en) › Western Europe › Europe
33
+ in 38d European Ruby Camp - eurucamp, Fri-Sun Jul/31-Aug/2 (3d) @ Berlin (Potsdam), Germany › Europe
34
+ in 38d JRuby Conference Europe - JRubyConf EU, Fri Jul/31 (1d) @ Berlin (Potdam), Germany › Europe
35
+ in 39d Burlington Ruby Conference, Sat+Sun Aug/1+2 (2d) @ Burlington, Vermont › New England › United States (us) › North America › America
36
+ in 59d Madison+ Ruby, Fri+Sat Aug/21+22 (2d) @ Madison, Wisconsin › Great Lakes › United States (us) › North America › America
37
+ in 70d Full Stack Fest - Barcelona Ruby Conference (BaRuCo) + Barcelona Future JS, Tue-Sat Sep/1-5 (5d) @ Barcelona, Catalonia › Spain / España (es) › Southern Europe › Europe
38
+ in 80d RubyConf Taiwan, Fri+Sat Sep/11+12 (2d) @ Taipei › Taiwan (tw) › Asia
39
+ in 83d RubyConf Portugal, Mon+Tue Sep/14+15 (2d) @ Braga › Portugal (pt) › Southern Europe › Europe
40
+ in 87d RubyConf Brasil, Fri+Sat Sep/18+19 (2d) @ São Paulo › Brazil / Brasil (br) › South America › America
41
+ in 92d Rocky Mountain Ruby Conference, Wed-Fri Sep/23-25 (3d) @ Boulder, Colorado › Rocky Mountains › United States (us) › North America › America
42
+ in 95d Ruby Open Source Software (ROSS) Conference - ROSSConf, Sat Sep/26 (1d) @ Berlin, Germany › Europe
43
+ in 100d ArrrCamp, Thu+Fri Oct/1+2 (2d) @ Ghent, Oost-Vlaanderen › Belgium / België / Belgique (be) › Western Europe › Europe
44
+ in 114d RubyConf Colombia, Thu+Fri Oct/15+16 (2d) @ Medellin › Colombia (co) › South America › America
45
+ in 116d European Ruby Konference - EuRuKo, Sat+Sun Oct/17+18 (2d) @ Salzburg, Austria › Europe
46
+ in 141d RubyWorld Conference, Wed+Thu Nov/11+12 (2d) @ Matsue › Japan (jp) › Asia
47
+ ...
48
+ ~~~
49
+
50
+
51
+ ### Upcoming Football Tournaments
52
+
53
+ Use
54
+
55
+ ~~~
56
+ $ kickoff
57
+ ~~~
58
+
59
+ to list upcoming football tournaments from around the world. Will print:
60
+
61
+ ~~~
62
+ Upcoming Football Tournaments:
63
+
64
+ NOW ON 18d Women's World Cup 2015, Sat-Sun Jun/6-Jul/5 (30d) @ Canada › World (FIFA)
65
+ NOW ON 13d Copa América 2015, Thu-Sat Jun/11-Jul/4 (24d) @ Chile › South America (CONMEBOL)
66
+
67
+ in 14d Gold Cup / Copa de Oro 2015, Tue-Sun Jul/7-26 (20d) @ United States+Canada › North America (CONCACAF)
68
+ in 346d Copa América 2016, Fri-Sun Jun/3-26 (24d) @ United States › South America (CONMEBOL)
69
+ in 353d European Championship (Euro) 2016, Fri-Sun Jun/10-Jul/10 (31d) @ France › Europe (UEFA)
70
+ in 1087d World Cup 2018, Thu-Sun Jun/14-Jul/15 (32d) @ Russia › World (FIFA)
71
+ ...
72
+ ~~~
73
+
74
+
75
+ ### Upcoming Beerfests
76
+
77
+ Use
78
+
79
+ ~~~
80
+ $ beerfest
81
+ ~~~
82
+
83
+ to list upcoming beer festivals from around the world. Will print:
84
+
85
+ ~~~
86
+ Upcoming Beerfests:
87
+
88
+ in 9d Ottakringer Braukultur Wochen (9 Brauereien in 9 Wochen), Thu-Wed Jul/2-Sep/2 (63d) @ 16., Ottakring › Vienna / Wien › Austria / Österreich (at) › Central Europe › Europe
89
+ in 31d Annafest ("Auf den Kellern"), Fri-Mon Jul/24-Aug/3 (11d) @ Forchheim › Upper Franconia / Oberfranken › Bavaria / Bayern › Germany / Deutschland (de) › Central Europe › Europe
90
+ in 32d Kulmbacher Bierwoche, Sat-Sun Jul/25-Aug/2 (9d) @ Kulmbach › Upper Franconia / Oberfranken › Bavaria / Bayern › Germany / Deutschland (de) › Central Europe › Europe
91
+ in 58d Sandwerka (Sandkirchweih), Thu-Mon Aug/20-24 (5d) @ Bamberg › Upper Franconia / Oberfranken › Bavaria / Bayern › Germany / Deutschland (de) › Central Europe › Europe
92
+ in 88d Oktoberfest ("Die Wiesn"), Sat-Sun Sep/19-Oct/4 (16d) @ Munich / München › Upper Bavaria / Oberbayern › Bavaria / Bayern › Germany / Deutschland (de) › Central Europe › Europe
93
+ in 123d Biermesse Ried (Festival der Biervielfalt), Sat+Sun Oct/24+25 (2d) @ Ried i. Innkreis › Upper Austria / Oberösterreich › Austria / Österreich (at) › Central Europe › Europe
94
+ ...
95
+ ~~~
96
+
97
+
98
+ ## Public Event Datasets
99
+
100
+ - [awesome-events @ Planet Ruby](https://github.com/planetruby/awesome-events) - a collection of awesome Ruby events (meetups, conferences, camps, etc.) from around the world
101
+ - [calendar @ football.db](https://github.com/openfootball/calendar) - a collection of awesome football tournaments, cups, etc. from around the world
102
+ - [calendar @ beer.db](https://github.com/openbeer/calendar) - a collection of awesome beer events (oktoberfest, starkbierfest, etc.) from around the world
15
103
 
16
104
 
17
105
  ## Install
@@ -26,3 +114,8 @@ Just install the gem:
26
114
  The `whatson` scripts are dedicated to the public domain.
27
115
  Use it as you please with no restrictions whatsoever.
28
116
 
117
+
118
+ ## Questions? Comments?
119
+
120
+ Send them along to the ruby-talk mailing list.
121
+ Thanks!
data/Rakefile CHANGED
@@ -18,6 +18,10 @@ Hoe.spec 'whatson' do
18
18
  self.history_file = 'HISTORY.md'
19
19
 
20
20
  self.extra_deps = [
21
+ ['eventdb', '>= 0.5.0'],
22
+ ## 3rd party
23
+ ['fetcher', '>= 0.4.5'],
24
+ ['sqlite3']
21
25
  ]
22
26
 
23
27
  self.licenses = ['Public Domain']
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ###################
4
+ # == DEV TIPS:
5
+ #
6
+ # For local testing run like:
7
+ #
8
+ # ruby -Ilib bin/beerfest
9
+ #
10
+ # Set the executable bit in Linux. Example:
11
+ #
12
+ # % chmod a+x bin/beerfest
13
+ #
14
+
15
+ require 'whatson'
16
+
17
+ WhatsOn::BeerFest.new.print
18
+
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ###################
4
+ # == DEV TIPS:
5
+ #
6
+ # For local testing run like:
7
+ #
8
+ # ruby -Ilib bin/kickoff
9
+ #
10
+ # Set the executable bit in Linux. Example:
11
+ #
12
+ # % chmod a+x bin/kickoff
13
+ #
14
+
15
+ require 'whatson'
16
+
17
+ WhatsOn::Football.new.print
18
+
@@ -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/rubyconf
9
+ #
10
+ # Set the executable bit in Linux. Example:
11
+ #
12
+ # % chmod a+x bin/rubyconf
13
+ #
14
+
15
+ require 'whatson'
16
+
17
+ WhatsOn::RubyConf.new.print
@@ -1,11 +1,22 @@
1
1
  # encoding: utf-8
2
2
 
3
3
 
4
+ # 3rd party libs (gems)
5
+ require 'eventdb'
6
+ require 'fetcher'
7
+
8
+
4
9
  # our own code
5
10
 
6
11
  require 'whatson/version' ## let version always go first
7
12
 
8
13
 
14
+ require 'whatson/beerfest' ## used by beerfest bin(ary) tool
15
+ require 'whatson/rubyconf' ## used by rubyconf bin(ary) tool
16
+ require 'whatson/football' ## used by kickoff bin(ary) tool
17
+
18
+
19
+
9
20
 
10
21
 
11
22
  # say hello
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+
3
+ module WhatsOn
4
+
5
+ class BeerFest
6
+
7
+ def initialize
8
+ ## turn down logger (default :debug?)
9
+ LogUtils::Logger.root.level = :info
10
+
11
+ r = EventDb::EventReader.from_url( "https://github.com/openbeer/calendar/raw/master/README.md" )
12
+ events = r.read
13
+
14
+ @db = EventDb::Database.new
15
+ @db.add( events )
16
+ end
17
+
18
+ def print
19
+ ## get next 17 events
20
+
21
+ today = Date.today
22
+
23
+ up = EventDb::Model::Event.limit( 17 ).upcoming( today )
24
+
25
+ ## pp up.to_sql
26
+ ## pp up
27
+
28
+ puts ''
29
+ puts ''
30
+ puts "Upcoming Beerfests:"
31
+ puts ''
32
+
33
+ on = EventDb::Model::Event.live( today )
34
+ on.each do |e|
35
+ current_day = today.mjd - e.start_date.mjd + 1 ## calculate current event day (1,2,3,etc.)
36
+ puts " NOW ON #{current_day}d #{e.title} #{e.start_date.year}, #{e.date_str} (#{e.days}d) @ #{e.place}"
37
+ end
38
+
39
+ puts '' if on.any?
40
+
41
+ up.each do |e|
42
+ diff_days = e.start_date.mjd - today.mjd ## note: mjd == Modified Julian Day Number
43
+ puts " in #{diff_days}d #{e.title}, #{e.date_str} (#{e.days}d) @ #{e.place}"
44
+ end
45
+ puts ''
46
+ puts " More @ github.com/openbeer/calendar"
47
+ puts ''
48
+ end
49
+
50
+ end # class BeerFest
51
+
52
+ end # module WhatsOn
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+
3
+ module WhatsOn
4
+
5
+ class Football
6
+
7
+ def initialize
8
+ ## turn down logger (default :debug?)
9
+ LogUtils::Logger.root.level = :info
10
+
11
+ r = EventDb::EventReader.from_url( "https://github.com/openfootball/calendar/raw/master/README.md" )
12
+ events = r.read
13
+
14
+ @db = EventDb::Database.new
15
+ @db.add( events )
16
+ end
17
+
18
+ def print
19
+ ## get next 17 events
20
+
21
+ today = Date.today
22
+
23
+ up = EventDb::Model::Event.limit( 17 ).upcoming( today )
24
+ ## pp up.to_sql
25
+ ## pp up
26
+
27
+
28
+ puts ''
29
+ puts ''
30
+ puts "Upcoming Football Tournaments:"
31
+ puts ''
32
+
33
+ on = EventDb::Model::Event.live( today )
34
+ on.each do |e|
35
+ current_day = today.mjd - e.start_date.mjd + 1 ## calculate current event day (1,2,3,etc.)
36
+ puts " NOW ON #{current_day}d #{e.title} #{e.start_date.year}, #{e.date_str} (#{e.days}d) @ #{e.place}"
37
+ end
38
+
39
+ puts '' if on.any?
40
+
41
+ up.each do |e|
42
+ diff_days = e.start_date.mjd - today.mjd ## note: mjd == Modified Julian Day Number
43
+ puts " in #{diff_days}d #{e.title} #{e.start_date.year}, #{e.date_str} (#{e.days}d) @ #{e.place}"
44
+ end
45
+ puts ''
46
+ puts " More @ github.com/openfootball/calendar"
47
+ puts ''
48
+ end
49
+
50
+ end # class Football
51
+
52
+ end # module WhatsOn
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+
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
+ r = EventDb::EventReader.from_url( "https://github.com/planetruby/awesome-events/raw/master/README.md" )
12
+ events = r.read
13
+
14
+ @db = EventDb::Database.new
15
+ @db.add( events )
16
+ end
17
+
18
+ def print
19
+ ## get next 17 events
20
+
21
+ today = Date.today
22
+
23
+ up = EventDb::Model::Event.limit( 17 ).upcoming( today )
24
+ ## pp up.to_sql
25
+ ## pp up
26
+
27
+ puts ''
28
+ puts ''
29
+ puts "Upcoming Ruby Conferences:"
30
+ puts ''
31
+
32
+ on = EventDb::Model::Event.live( today )
33
+ on.each do |e|
34
+ current_day = today.mjd - e.start_date.mjd + 1 ## calculate current event day (1,2,3,etc.)
35
+ puts " NOW ON #{current_day}d #{e.title} #{e.start_date.year}, #{e.date_str} (#{e.days}d) @ #{e.place}"
36
+ end
37
+
38
+ puts '' if on.any?
39
+
40
+ up.each do |e|
41
+ diff_days = e.start_date.mjd - today.mjd ## note: mjd == Modified Julian Day Number
42
+ puts " in #{diff_days}d #{e.title}, #{e.date_str} (#{e.days}d) @ #{e.place}"
43
+ end
44
+ puts ''
45
+ puts " More @ github.com/planetruby/awesome-events"
46
+ puts ''
47
+ end
48
+
49
+ end # class RubyConf
50
+
51
+ end # module WhatsOn
@@ -3,8 +3,8 @@
3
3
  module WhatsOn
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
- MINOR = 0
7
- PATCH = 1
6
+ MINOR = 1
7
+ PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -0,0 +1,8 @@
1
+
2
+
3
+ ## minitest setup
4
+ require 'minitest/autorun'
5
+
6
+ ## our own code
7
+ require 'whatson'
8
+
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ ###
4
+ # to run use
5
+ # ruby -I ./lib -I ./test test/test_rubyconf.rb
6
+
7
+
8
+ require 'helper'
9
+
10
+ class TestRubyConf < MiniTest::Test
11
+
12
+ def test_print
13
+
14
+ r = WhatsOn::RubyConf.new
15
+ r.print
16
+ r.print
17
+
18
+ assert true # assume ok if we get here
19
+ end
20
+
21
+ end # class TestRubyConf
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
@@ -10,6 +10,48 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: eventdb
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: fetcher
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.5
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.5
41
+ - !ruby/object:Gem::Dependency
42
+ name: sqlite3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
13
55
  - !ruby/object:Gem::Dependency
14
56
  name: rdoc
15
57
  requirement: !ruby/object:Gem::Requirement
@@ -40,19 +82,31 @@ dependencies:
40
82
  version: '3.13'
41
83
  description: whatson - what's on now command line tool (using the event.db machinery)
42
84
  email: ruby-talk@ruby-lang.org
43
- executables: []
85
+ executables:
86
+ - beerfest
87
+ - kickoff
88
+ - rubyconf
44
89
  extensions: []
45
90
  extra_rdoc_files:
46
91
  - HISTORY.md
47
92
  - Manifest.txt
48
93
  - README.md
49
94
  files:
95
+ - ".gemtest"
50
96
  - HISTORY.md
51
97
  - Manifest.txt
52
98
  - README.md
53
99
  - Rakefile
100
+ - bin/beerfest
101
+ - bin/kickoff
102
+ - bin/rubyconf
54
103
  - lib/whatson.rb
104
+ - lib/whatson/beerfest.rb
105
+ - lib/whatson/football.rb
106
+ - lib/whatson/rubyconf.rb
55
107
  - lib/whatson/version.rb
108
+ - test/helper.rb
109
+ - test/test_rubyconf.rb
56
110
  homepage: https://github.com/textkit/whatson
57
111
  licenses:
58
112
  - Public Domain
@@ -79,4 +133,5 @@ rubygems_version: 2.4.2
79
133
  signing_key:
80
134
  specification_version: 4
81
135
  summary: whatson - what's on now command line tool (using the event.db machinery)
82
- test_files: []
136
+ test_files:
137
+ - test/test_rubyconf.rb