meetup-generator 0.0.20210128

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'pathname'
5
+ require 'minitest/autorun'
6
+ require_relative '../lib/meetup_generator'
7
+
8
+ THINGS = { food_style: %w[artisan],
9
+ food: %w[flatbread],
10
+ first_name: %w[John],
11
+ last_name: %w[Smith],
12
+ job_role: %w[Neckbeard],
13
+ job_title: ['Without Portfolio'],
14
+ tech: %w[Ruby],
15
+ something_ops: %w[Dev Test No],
16
+ template: ['%RAND20% %tech% things'] }.freeze
17
+
18
+ class TestMeetupGenerator < Minitest::Test
19
+ attr_reader :mg
20
+
21
+ def setup
22
+ @mg = MeetupGenerator.new
23
+ end
24
+
25
+ def test_words
26
+ assert_instance_of(Array, mg.words)
27
+ assert mg.words.size > 19_000
28
+ assert_includes(mg.words, 'woebegone')
29
+ end
30
+
31
+ def test_lib
32
+ assert_instance_of(Hash, mg.lib)
33
+ assert_includes(mg.lib[:tech], 'SmartOS')
34
+
35
+ %i[verb tech service extreme quantifier time food_style food
36
+ skill_level is_not company driver adjective panacea language
37
+ something_ops template first_name last_name job_role
38
+ job_title].each do |k|
39
+ assert_includes(mg.lib.keys, k)
40
+ assert_instance_of(Array, mg.lib[k])
41
+ end
42
+ end
43
+ end
44
+
45
+ # We don't want the class properly initialized
46
+ #
47
+ class Giblets < MeetupGenerator
48
+ # rubocop:disable Lint/MissingSuper
49
+ def initialize; end
50
+ # rubocop:enable Lint/MissingSuper
51
+ end
52
+
53
+ # Test the uninitialized class
54
+ #
55
+ class GibletsTest < MiniTest::Test
56
+ attr_reader :m
57
+
58
+ def setup
59
+ @m = Giblets.new
60
+ m.instance_variable_set(:@lib, THINGS)
61
+ m.instance_variable_set(:@words, %w[leadswinger])
62
+ end
63
+
64
+ def _test_title
65
+ x = m.title
66
+ assert_instance_of(String, x)
67
+ assert !x.empty?
68
+ refute_match(/%\w+%/, x)
69
+ end
70
+
71
+ def test_agenda
72
+ agenda = m.agenda(1)
73
+ talks = agenda[:talks]
74
+
75
+ assert_instance_of(Array, talks)
76
+ assert_equal(1, talks.size)
77
+
78
+ talk = talks.first
79
+ assert_instance_of(Hash, talk)
80
+
81
+ assert_equal(%i[title talker role company], talk.keys)
82
+ tokens = talk[:title].split
83
+ number = tokens.first.to_i
84
+ assert number.positive?
85
+ assert number <= 20
86
+ assert_equal('Ruby', tokens[1])
87
+ assert_equal('things', tokens[2])
88
+
89
+ assert_equal('artisan flatbread', agenda[:refreshment])
90
+ end
91
+
92
+ def test_something_ops
93
+ assert m.something_ops.is_a?(String)
94
+ assert m.something_ops.end_with?('Ops')
95
+ end
96
+
97
+ def test_talker
98
+ assert_equal('John Smith', m.talker)
99
+ end
100
+
101
+ def test_role
102
+ assert_equal('Neckbeard Without Portfolio', m.role)
103
+ end
104
+
105
+ def test_company_no_e
106
+ assert_equal('leadswingr.io', m.company)
107
+ end
108
+
109
+ def test_company
110
+ m.instance_variable_set(:@words, %w[cabbage])
111
+ assert_equal('cabbage.io', m.company)
112
+ end
113
+
114
+ def test_replace_word
115
+ assert_equal('LeadswingerOps', m.replace_word('%WORD%Ops'))
116
+ end
117
+
118
+ def test_refreshment
119
+ assert_equal('artisan flatbread', m.refreshment)
120
+ end
121
+
122
+ def test_replace_things
123
+ x = m.replace_things('%tech% is %tech%')
124
+ assert_equal('Ruby is Ruby', x)
125
+ end
126
+
127
+ def test_replace_ops
128
+ x = m.replace_ops('From %FNOPS% to %FNOPS%')
129
+ assert_instance_of(String, x)
130
+ assert_match(/From \w+Ops to \w+Ops$/, x)
131
+ end
132
+
133
+ def test_replace_number
134
+ x = m.replace_number('%RAND9% years and %RAND5% months')
135
+ assert_instance_of(String, x)
136
+ assert_match(/\d years and \d months/, x)
137
+ end
138
+ end
@@ -0,0 +1,48 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title #Devops Meetup
5
+ meta charset='utf-8'
6
+ link href='/css/main.css' rel='stylesheet'
7
+
8
+ body
9
+ #container
10
+ h1
11
+ ' #DevOps Meetup //
12
+ => @agenda[:location]
13
+ ' //
14
+ == @agenda[:date]
15
+
16
+ ul
17
+ li 18:00 // Introduction
18
+
19
+ li
20
+ ' 18:10 // Lightning talk //
21
+ == slim :partial_talk
22
+
23
+ li
24
+ ' 18:20 //
25
+ == slim :partial_talk
26
+
27
+ li
28
+ ' 18:50 // break
29
+ .indent=@agenda[:refreshment]
30
+
31
+ li
32
+ ' 19:20 //
33
+ == slim :partial_talk
34
+
35
+ li
36
+ ' 19:40 // Ignite //
37
+ == slim :partial_talk
38
+
39
+ li
40
+ ' 20:00 //
41
+ == slim :partial_talk
42
+
43
+ li
44
+ ' 20:30 // Close
45
+ .indent Everyone is hiring, but no one's paying
46
+
47
+ #footer
48
+ a href='https://github.com/snltd/meetup-generator' The code.
@@ -0,0 +1,11 @@
1
+ - talk = @agenda[:talks].pop
2
+
3
+ span.ttitle=talk[:title]
4
+ .indent
5
+ => talk[:talker]
6
+ ' //
7
+ => talk[:role]
8
+ ' @
9
+ a href="http://#{talk[:company]}"
10
+ == talk[:company]
11
+
metadata ADDED
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: meetup-generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.20210128
5
+ platform: ruby
6
+ authors:
7
+ - Robert Fisher
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: puma
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sinatra
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: slim
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.14'
83
+ - !ruby/object:Gem::Dependency
84
+ name: nokogiri
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.10'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rack-test
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.1'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '13.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '13.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.9'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.9'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-minitest
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.10'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.10'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-performance
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.3'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.3'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-rake
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.5'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.5'
181
+ description: Generates a website advertising a fictional DevOps meetup, using all
182
+ the latest buzzwords, new-shiny, and clichés
183
+ email: rob@sysdef.xyz
184
+ executables:
185
+ - meetup-generator.rb
186
+ - locate_meetup-generator
187
+ extensions: []
188
+ extra_rdoc_files: []
189
+ files:
190
+ - Gemfile
191
+ - Gemfile.lock
192
+ - LICENSE.txt
193
+ - README.md
194
+ - Rakefile
195
+ - bin/locate_meetup-generator
196
+ - bin/meetup-generator.rb
197
+ - config.ru
198
+ - lib/all_the_things.yaml
199
+ - lib/locator.rb
200
+ - lib/meetup_generator.rb
201
+ - lib/words.gz
202
+ - meetup-generator.gemspec
203
+ - package/meetup-generator.xml
204
+ - public/css/main.css
205
+ - public/favicon.ico
206
+ - public/zxspectr.woff
207
+ - spec/acceptance_spec.rb
208
+ - spec/meetup_generator_spec.rb
209
+ - views/default.slim
210
+ - views/partial_talk.slim
211
+ homepage: https://github.com/snltd/meetup-generator
212
+ licenses:
213
+ - BSD-2-Clause
214
+ metadata: {}
215
+ post_install_message:
216
+ rdoc_options: []
217
+ require_paths:
218
+ - lib
219
+ required_ruby_version: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: 2.5.0
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ requirements: []
230
+ rubygems_version: 3.0.8
231
+ signing_key:
232
+ specification_version: 4
233
+ summary: Stupid fatuous random string generatpr
234
+ test_files:
235
+ - spec/acceptance_spec.rb
236
+ - spec/meetup_generator_spec.rb