eventdb 0.4.0 → 0.5.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: f4ecf3a00ba721c3e1aa1db88e8532c2d79d92e2
4
- data.tar.gz: dbc1badb13aa63a7a3cd2f8147d774d5cae16e1b
3
+ metadata.gz: 5581ae0b83f990cdd56b947c0b504fdf973435aa
4
+ data.tar.gz: 71d16f477128f028f6db5a0703b1e656d2c20cce
5
5
  SHA512:
6
- metadata.gz: a240f380814645a727bee1dac67ab71aefcc51a3202daa90fc4172266e2961775961b0e57ca200a6a0c67731a9176f8f8b22bf5b51fe0020a8d24c7e9e0e62e3
7
- data.tar.gz: 6499fcd85cb2df1c821ca50b32d05f5eae22228f106730ee0ba1463cee4cdcf532d3ba2355e436874b449c2ee09d2f4322b867b7075ffdf34ea9e42cab80e613
6
+ metadata.gz: 153c35ffef9355d7624b7a4e828ea8f60abb4f44b9a899478806191ea75f71e1793ff86a25b777e5de7feaedb2a00ddfdf1c82efbcfe2226e51fdad91b86275e
7
+ data.tar.gz: 2bc79006fcb71edb6301c686a1716aa5ee0dfca9b7c16a7365f6135fb64daa85891eccbf454971faa1b99cfc675a682be5361b6e6c577bfcb2fffe591e26c8f9
data/Manifest.txt CHANGED
@@ -2,15 +2,9 @@ HISTORY.md
2
2
  Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
- bin/beerfest
6
- bin/kickoff
7
- bin/rubyconf
8
5
  lib/eventdb.rb
9
6
  lib/eventdb/calendar.rb
10
7
  lib/eventdb/database.rb
11
- lib/eventdb/datasets/beerfest.rb
12
- lib/eventdb/datasets/football.rb
13
- lib/eventdb/datasets/rubyconf.rb
14
8
  lib/eventdb/models.rb
15
9
  lib/eventdb/reader.rb
16
10
  lib/eventdb/schema.rb
@@ -21,5 +15,4 @@ test/helper.rb
21
15
  test/test_calendar.rb
22
16
  test/test_database.rb
23
17
  test/test_reader.rb
24
- test/test_rubyconf.rb
25
18
  test/test_version.rb
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # event.db
2
2
 
3
- event.db models n tools
3
+ event.db schema 'n' models for easy (re)use
4
4
 
5
5
  * home :: [github.com/textkit/event.db](https://github.com/textkit/event.db)
6
6
  * bugs :: [github.com/textkit/event.db/issues](https://github.com/textkit/event.db/issues)
@@ -9,88 +9,67 @@ event.db models n tools
9
9
  * forum :: [ruby-talk@ruby-lang.org](http://www.ruby-lang.org/en/community/mailing-lists)
10
10
 
11
11
 
12
- ## Command-Line Tool Usage
12
+ ## Command Line Tools
13
13
 
14
- The eventdb gem includes command-line tools
15
- to list upcoming events (ruby conferences, football tournaments, beer festivals. etc.).
14
+ NOTE: The command-line tools (e.g. rubyconf, kickoff, beerfest, etc.)
15
+ for listing upcoming events (ruby conferences, football tournaments, beer festivals. etc.)
16
+ moved to its own gem, that is, whatson.
17
+ See the [whatson project for more »](https://github.com/textkit/whatson)
16
18
 
17
19
 
18
- ### Upcoming Ruby Conferences
19
20
 
20
- Use
21
+ ## Usage
21
22
 
22
23
  ~~~
23
- $ rubyconf
24
- ~~~
25
-
26
- to list upcoming Ruby (un)conferences from around the world. Will print:
27
-
28
- ~~~
29
- Upcoming Ruby Conferences:
24
+ r = EventDb::EventReader.from_url( "https://github.com/planetruby/awesome-events/raw/master/README.md" )
25
+ events = r.read
30
26
 
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
- ~~~
27
+ db = EventDb::Database.new # note: by default uses in-memory SQLite database
28
+ db.add( events )
49
29
 
50
30
 
51
- ### Upcoming Football Tournaments
31
+ today = Date.today
52
32
 
53
- Use
33
+ puts 'Upcoming Ruby Conferences:'
34
+ puts ''
54
35
 
55
- ~~~
56
- $ kickoff
57
- ~~~
36
+ on = EventDb::Model::Event.live( today )
37
+ on.each do |e|
38
+ current_day = today.mjd - e.start_date.mjd + 1 # calculate current event day (1,2,3,etc.)
39
+ puts " NOW ON #{current_day}d #{e.title} #{e.start_date.year}, #{e.date_str} (#{e.days}d) @ #{e.place}"
40
+ end
58
41
 
59
- to list upcoming football tournaments from around the world. Will print:
42
+ puts '' if on.any?
60
43
 
44
+ up = EventDb::Model::Event.limit( 17 ).upcoming( today )
45
+ up.each do |e|
46
+ diff_days = e.start_date.mjd - today.mjd # note: mjd == Modified Julian Day Number
47
+ puts " in #{diff_days}d #{e.title}, #{e.date_str} (#{e.days}d) @ #{e.place}"
48
+ end
61
49
  ~~~
62
- Upcoming Football Tournaments:
63
50
 
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)
51
+ will print:
66
52
 
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
53
  ~~~
54
+ Upcoming Ruby Conferences:
73
55
 
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 EuropeEurope
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) @ KulmbachUpper 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
56
+ NOW ON 2d RubyMotion Conference - #inspect, Wed+Thu Jul/1+2 (2d) @ Paris, France › Europe
57
+
58
+ in 18d Brighton Ruby Conference, Mon Jul/20 (1d) @ Brighton, East Sussex › England (en) › Western Europe › Europe
59
+ in 27d European Ruby Camp - eurucamp, Fri-Sun Jul/31-Aug/2 (3d) @ Berlin (Potsdam), Germany › Europe
60
+ in 27d JRuby Conference Europe - JRubyConf EU, Fri Jul/31 (1d) @ Berlin (Potdam), Germany › Europe
61
+ in 28d Burlington Ruby Conference, Sat+Sun Aug/1+2 (2d) @ Burlington, Vermont › New England › United States (us) › North America › America
62
+ in 50d Madison+ Ruby, Fri+Sat Aug/21+22 (2d) @ Madison, Wisconsin › Great Lakes › United States (us) › North America › America
63
+ in 61d 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
64
+ in 71d RubyConf Taiwan, Fri+Sat Sep/11+12 (2d) @ Taipei › Taiwan (tw) › Asia
65
+ in 72d RubyConf Portugal, Mon+Tue Sep/14+15 (2d) @ Braga Portugal (pt) › Southern Europe › Europe
66
+ in 78d RubyConf Brasil, Fri+Sat Sep/18+19 (2d) @ São Paulo › Brazil / Brasil (br) › South America › America
67
+ in 83d Rocky Mountain Ruby Conference, Wed-Fri Sep/23-25 (3d) @ Boulder, Colorado › Rocky Mountains › United States (us) › North America › America
68
+ in 85d Ruby Open Source Software (ROSS) Conference - ROSSConf, Sat Sep/26 (1d) @ Berlin, Germany › Europe
69
+ in 93d ArrrCamp, Thu+Fri Oct/1+2 (2d) @ Ghent, Oost-Vlaanderen › Belgium / België / Belgique (be) › Western Europe › Europe
70
+ in 105d RubyConf Colombia, Thu+Fri Oct/15+16 (2d) @ MedellinColombia (co) › South AmericaAmerica
71
+ in 107d European Ruby Konference - EuRuKo, Sat+Sun Oct/17+18 (2d) @ Salzburg, Austria › Europe
72
+ in 132d RubyWorld Conference, Wed+Thu Nov/11+12 (2d) @ MatsueJapan (jp) › Asia
94
73
  ...
95
74
  ~~~
96
75
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ Hoe.spec 'eventdb' do
5
5
 
6
6
  self.version = EventDb::VERSION
7
7
 
8
- self.summary = 'eventdb - event.db models n tools'
8
+ self.summary = "eventdb - event.db schema 'n' models for easy (re)use"
9
9
  self.description = summary
10
10
 
11
11
  self.urls = ['https://github.com/textkit/event.db']
@@ -21,15 +21,15 @@ Hoe.spec 'eventdb' do
21
21
  ['props', '>= 1.1.2'], # settings / prop(ertie)s / env / INI
22
22
  ['logutils', '>= 0.6.1'], # logging
23
23
  ['textutils', '>= 1.3.1'],
24
- ['tagutils', '>= 0.3.0'], # tags n categories for activerecord
25
- ['activerecord-utils', '>= 0.4.0'],
26
- ['props-activerecord', '>= 0.1.0'],
27
- ['logutils-activerecord', '>= 0.2.1'],
28
24
 
29
25
  ## 3rd party
30
- ['fetcher', '>= 0.4.5'],
31
26
  ['activerecord'], # NB: will include activesupport,etc.
32
- ['sqlite3']
27
+
28
+ ## more activerecord utils/addons
29
+ ## ['tagutils', '>= 0.3.0'], # tags n categories for activerecord
30
+ ## ['activerecord-utils', '>= 0.4.0'],
31
+ ['props-activerecord', '>= 0.1.0'],
32
+ ['logutils-activerecord', '>= 0.2.1'],
33
33
  ]
34
34
 
35
35
  self.licenses = ['Public Domain']
data/lib/eventdb.rb CHANGED
@@ -10,9 +10,10 @@ require 'erb'
10
10
  require 'props'
11
11
  require 'logutils'
12
12
  require 'textutils'
13
+
13
14
  require 'props/activerecord'
14
15
  require 'logutils/activerecord'
15
- require 'fetcher'
16
+
16
17
 
17
18
  # our own code
18
19
 
@@ -26,11 +27,6 @@ require 'eventdb/models'
26
27
  require 'eventdb/database'
27
28
 
28
29
 
29
- require 'eventdb/datasets/beerfest' ## used by beerfest bin(ary) tool
30
- require 'eventdb/datasets/rubyconf' ## used by rubyconf bin(ary) tool
31
- require 'eventdb/datasets/football' ## used by kickoff bin(ary) tool
32
-
33
-
34
30
 
35
31
  # say hello
36
32
  puts EventDb.banner if defined?($RUBYLIBS_DEBUG) && $RUBYLIBS_DEBUG
@@ -3,7 +3,7 @@
3
3
  module EventDb
4
4
 
5
5
  MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
- MINOR = 4
6
+ MINOR = 5
7
7
  PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
data/test/data/RUBY.md CHANGED
@@ -98,7 +98,7 @@ NOTE: A calendar page ([CALENDAR.md](CALENDAR.md)) gets auto-generated from this
98
98
  - 2015 @ Berlin, Germany; Sept/26
99
99
  - 2015 @ Vienna, Austria; Apr/25
100
100
  - [JRuby Conference Europe - JRubyConf EU](http://jrubyconf.eu)
101
- - 2015 @ Berlin (Potdam), Germany; Jul/31
101
+ - 2015 @ Berlin (Potsdam), Germany; Jul/31
102
102
  - [RubyMotion Conference - #inspect](http://conference.rubymotion.com)
103
103
  - 2015 @ Paris, France; Jul/1+2
104
104
 
@@ -240,7 +240,7 @@ NOTE: A calendar page ([CALENDAR.md](CALENDAR.md)) gets auto-generated from this
240
240
  #### Spain / España (es)
241
241
 
242
242
  - [Full Stack Fest - Barcelona Ruby Conference (BaRuCo) + Barcelona Future JS](http://www.fullstackfest.com)
243
- - 2015 @ Barcelona, Catalonia; Sept/15
243
+ - 2015 @ Barcelona, Catalonia; Sept/1-5
244
244
 
245
245
  <!-- new list; user groups -->
246
246
 
data/test/helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
 
2
3
 
3
4
  ## minitest setup
@@ -19,17 +19,14 @@ class TestDatabase < MiniTest::Test
19
19
  db.add( events )
20
20
 
21
21
  ## get next 17 events
22
- up = EventDb::Model::Event.limit( 17 )
23
- .order( 'start_date' )
24
- .where( 'start_date >= ?', Date.today )
22
+ up = EventDb::Model::Event.limit( 17 ).upcoming( Date.today )
25
23
  pp up.to_sql
26
24
  pp up
27
25
 
28
26
  puts "Upcoming Ruby Conferences:"
29
27
  up.each do |e|
30
- puts " #{e.date} - #{e.title} @ #{e.place}"
28
+ puts " #{e.date} | #{e.date_str} - #{e.title} @ #{e.place}"
31
29
  end
32
- puts " More @ github.com/planetruby/awesome-events"
33
30
 
34
31
  assert true # assume ok if we get here
35
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
@@ -53,33 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: tagutils
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 0.3.0
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 0.3.0
69
- - !ruby/object:Gem::Dependency
70
- name: activerecord-utils
56
+ name: activerecord
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: 0.4.0
61
+ version: '0'
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - ">="
81
67
  - !ruby/object:Gem::Version
82
- version: 0.4.0
68
+ version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: props-activerecord
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -108,48 +94,6 @@ dependencies:
108
94
  - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: 0.2.1
111
- - !ruby/object:Gem::Dependency
112
- name: fetcher
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: 0.4.5
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.4.5
125
- - !ruby/object:Gem::Dependency
126
- name: activerecord
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: sqlite3
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
97
  - !ruby/object:Gem::Dependency
154
98
  name: rdoc
155
99
  requirement: !ruby/object:Gem::Requirement
@@ -178,12 +122,9 @@ dependencies:
178
122
  - - "~>"
179
123
  - !ruby/object:Gem::Version
180
124
  version: '3.13'
181
- description: eventdb - event.db models n tools
125
+ description: eventdb - event.db schema 'n' models for easy (re)use
182
126
  email: ruby-talk@ruby-lang.org
183
- executables:
184
- - beerfest
185
- - kickoff
186
- - rubyconf
127
+ executables: []
187
128
  extensions: []
188
129
  extra_rdoc_files:
189
130
  - HISTORY.md
@@ -195,15 +136,9 @@ files:
195
136
  - Manifest.txt
196
137
  - README.md
197
138
  - Rakefile
198
- - bin/beerfest
199
- - bin/kickoff
200
- - bin/rubyconf
201
139
  - lib/eventdb.rb
202
140
  - lib/eventdb/calendar.rb
203
141
  - lib/eventdb/database.rb
204
- - lib/eventdb/datasets/beerfest.rb
205
- - lib/eventdb/datasets/football.rb
206
- - lib/eventdb/datasets/rubyconf.rb
207
142
  - lib/eventdb/models.rb
208
143
  - lib/eventdb/reader.rb
209
144
  - lib/eventdb/schema.rb
@@ -214,7 +149,6 @@ files:
214
149
  - test/test_calendar.rb
215
150
  - test/test_database.rb
216
151
  - test/test_reader.rb
217
- - test/test_rubyconf.rb
218
152
  - test/test_version.rb
219
153
  homepage: https://github.com/textkit/event.db
220
154
  licenses:
@@ -241,9 +175,8 @@ rubyforge_project:
241
175
  rubygems_version: 2.4.2
242
176
  signing_key:
243
177
  specification_version: 4
244
- summary: eventdb - event.db models n tools
178
+ summary: eventdb - event.db schema 'n' models for easy (re)use
245
179
  test_files:
246
- - test/test_rubyconf.rb
247
180
  - test/test_calendar.rb
248
181
  - test/test_database.rb
249
182
  - test/test_version.rb
data/bin/beerfest DELETED
@@ -1,18 +0,0 @@
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 'eventdb'
16
-
17
- EventDb::BeerFest.new.print
18
-
data/bin/kickoff DELETED
@@ -1,18 +0,0 @@
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 'eventdb'
16
-
17
- EventDb::Football.new.print
18
-
data/bin/rubyconf DELETED
@@ -1,17 +0,0 @@
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 'eventdb'
16
-
17
- EventDb::RubyConf.new.print
@@ -1,52 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module EventDb
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 EventDb
@@ -1,52 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module EventDb
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 EventDb
@@ -1,51 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module EventDb
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 EventDb
@@ -1,21 +0,0 @@
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 = EventDb::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