lurker 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.gitignore +1 -0
  5. data/.travis.yml +4 -4
  6. data/README.md +4 -2
  7. data/Rakefile +13 -1
  8. data/features/controller_specs/nested_schema_scaffolding.feature +4 -4
  9. data/features/controller_specs/test_endpoint.feature +36 -15
  10. data/features/request_specs/nested_schema_scaffolding.feature +4 -4
  11. data/features/request_specs/schema_suffixes.feature +173 -0
  12. data/features/support/env.rb +7 -1
  13. data/gemfiles/Gemfile32.ci +6 -0
  14. data/{Gemfile.ci → gemfiles/Gemfile40.ci} +3 -1
  15. data/gemfiles/Gemfile41.ci +6 -0
  16. data/lib/lurker.rb +0 -2
  17. data/lib/lurker/cli.rb +10 -55
  18. data/lib/lurker/controller_spec_watcher.rb +12 -6
  19. data/lib/lurker/endpoint.rb +1 -1
  20. data/lib/lurker/presenters/base_presenter.rb +0 -13
  21. data/lib/lurker/presenters/endpoint_presenter.rb +7 -6
  22. data/lib/lurker/presenters/json_presenter.rb +0 -9
  23. data/lib/lurker/presenters/response_code_presenter.rb +0 -9
  24. data/lib/lurker/presenters/schema_presenter.rb +1 -33
  25. data/lib/lurker/presenters/service_presenter.rb +2 -24
  26. data/lib/lurker/request_spec_watcher.rb +11 -6
  27. data/lib/lurker/service.rb +1 -1
  28. data/lib/lurker/templates/javascripts/application.js +0 -2
  29. data/lib/lurker/templates/public/application.css +0 -148
  30. data/lib/lurker/templates/public/application.js +2 -1904
  31. data/lib/lurker/templates/stylesheets/application.css +0 -2
  32. data/lib/lurker/version.rb +1 -1
  33. data/lurker.gemspec +2 -1
  34. data/templates/generate_stuff.rb +111 -22
  35. data/templates/lurker_app.rb +0 -5
  36. metadata +31 -32
  37. metadata.gz.asc +7 -7
  38. data/lib/lurker/meta_service.rb +0 -46
  39. data/lib/lurker/presenters/meta_service_presenter.rb +0 -85
  40. data/lib/lurker/templates/endpoint.html.erb +0 -62
  41. data/lib/lurker/templates/endpoint.md.erb +0 -40
  42. data/lib/lurker/templates/javascripts/demo/dashboard-demo.js +0 -117
  43. data/lib/lurker/templates/javascripts/demo/flot-demo.js +0 -1242
  44. data/lib/lurker/templates/javascripts/demo/morris-demo.js +0 -155
  45. data/lib/lurker/templates/javascripts/plugins/dataTables/dataTables.bootstrap.js +0 -245
  46. data/lib/lurker/templates/javascripts/plugins/dataTables/jquery.dataTables.js +0 -14013
  47. data/lib/lurker/templates/javascripts/plugins/flot/excanvas.min.js +0 -1
  48. data/lib/lurker/templates/javascripts/plugins/flot/jquery.flot.js +0 -2599
  49. data/lib/lurker/templates/javascripts/plugins/flot/jquery.flot.pie.js +0 -750
  50. data/lib/lurker/templates/javascripts/plugins/flot/jquery.flot.resize.js +0 -60
  51. data/lib/lurker/templates/javascripts/plugins/flot/jquery.flot.tooltip.min.js +0 -12
  52. data/lib/lurker/templates/javascripts/plugins/morris/morris.js +0 -1888
  53. data/lib/lurker/templates/javascripts/plugins/morris/raphael-2.1.0.min.js +0 -10
  54. data/lib/lurker/templates/lurker/rendering/_endpoint.html.erb +0 -65
  55. data/lib/lurker/templates/meta_service.html.erb +0 -54
  56. data/lib/lurker/templates/service.html.erb +0 -50
  57. data/lib/lurker/templates/service.md.erb +0 -18
  58. data/lib/lurker/templates/styles.css +0 -75
  59. data/lib/lurker/templates/stylesheets/plugins/dataTables/dataTables.bootstrap.css +0 -233
  60. data/lib/lurker/templates/stylesheets/plugins/morris/morris-0.4.3.min.css +0 -2
  61. data/lib/lurker/templates/stylesheets/plugins/social-buttons/social-buttons.css +0 -68
  62. data/lib/lurker/templates/stylesheets/plugins/timeline/timeline.css +0 -144
@@ -1,8 +1,6 @@
1
1
  /*
2
2
  *= require bootstrap
3
3
  *= require font-awesome/css/font-awesome
4
- *= require plugins/morris/morris-0.4.3.min
5
- *= require plugins/timeline/timeline
6
4
  *= require sb-admin
7
5
  *
8
6
  *= require prettify
@@ -1,3 +1,3 @@
1
1
  module Lurker
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
data/lurker.gemspec CHANGED
@@ -28,12 +28,13 @@ Gem::Specification.new do |spec|
28
28
  # testing
29
29
  spec.add_development_dependency("psych", "~> 2.0")
30
30
  spec.add_development_dependency("bundler", "~> 1.3")
31
- spec.add_development_dependency("rails", "~> 4.1")
31
+ spec.add_development_dependency("rails", '>= 3.2', '< 4.2')
32
32
  spec.add_development_dependency("rake", "~> 10.2")
33
33
  spec.add_development_dependency("rspec", "~> 2.14")
34
34
  spec.add_development_dependency("cucumber", "~> 1.3")
35
35
  spec.add_development_dependency("aruba", "~> 0.5")
36
36
  spec.add_development_dependency("capybara", "~> 2.2")
37
+ spec.add_development_dependency("nokogiri", "~> 1.5.11")
37
38
  spec.add_development_dependency("poltergeist", "~> 1.5")
38
39
  spec.add_development_dependency("database_cleaner", "~> 1.2")
39
40
 
@@ -1,14 +1,49 @@
1
1
  # gsub_file 'config/database.yml', /database: lurker_app.*/, 'database: lurker_app'
2
- create_link "bin/lurker", "#{File.expand_path '../../bin/lurker', __FILE__}"
2
+ # comment_lines 'config/database.yml', /username|password/
3
+ file 'config/database.yml', force: true do
4
+ <<-CODE
5
+ default: &default
6
+ adapter: postgresql
7
+ encoding: unicode
8
+ database: lurker_app
9
+ pool: 5
10
+ test:
11
+ <<: *default
12
+ database: lurker_app_test
13
+ development:
14
+ <<: *default
15
+ production:
16
+ url: <%= ENV['DATABASE_URL'] %>
17
+ CODE
18
+ end
19
+
20
+ copy_file "#{File.expand_path '../../bin/lurker', __FILE__}", "bin/lurker"
21
+ inject_into_file "bin/lurker", before: /require .lurker.$/ do
22
+ <<-CODE
23
+ if (simplecov_root = ENV['SIMPLECOV_ROOT']) && (simplecov_cmdname = ENV['SIMPLECOV_CMDNAME'])
24
+ require 'simplecov'
25
+ SimpleCov.start
26
+ SimpleCov.root simplecov_root
27
+ SimpleCov.command_name "\#{simplecov_cmdname}-binstub"
28
+ SimpleCov.start do
29
+ filters.clear # This will remove the :root_filter that comes via simplecov's defaults
30
+ add_filter do |src|
31
+ !(src.filename =~ /^\#{SimpleCov.root}\\/lib\\/lurker/)
32
+ end
33
+ end
34
+ end
35
+ CODE
36
+ end
37
+ chmod "bin/lurker", 0755
3
38
 
4
39
  remove_file 'spec/spec_helper.rb'
5
40
  remove_file 'app/models/user.rb'
6
41
 
7
42
  generate 'rspec:install'
8
- generate 'model User name:string --no-timestamps --no-test-framework'
9
- generate 'model Repo user:references name:string --no-timestamps --no-test-framework'
10
43
 
11
44
  route <<-ROUTE
45
+ mount Lurker::Server.to_rack(path: 'html'), at: "/#{Lurker::DEFAULT_URL_BASE}"
46
+
12
47
  namespace :api do
13
48
  namespace :v1 do
14
49
  resources :users do
@@ -20,13 +55,47 @@ route <<-ROUTE
20
55
  root to: redirect('/lurker')
21
56
  ROUTE
22
57
 
58
+ generate 'model User name:string --no-timestamps --no-test-framework --no-migration'
59
+ generate 'model Repo user:references name:string --no-timestamps --no-test-framework --no-migration'
60
+
61
+ file 'config/initializers/serializer.rb', force: true do
62
+ <<-CODE
63
+ module ExactOrderAsJson
64
+ # we need EXACT order for json attributes generation (e.g. rails32 sorts it)
65
+ # see: https://github.com/rails/rails/pull/5678/files
66
+ #
67
+ # options[:only] gets ordered like `attributes.keys` (via &=)
68
+ # attributes order is also inconsistent, so use options[:methods]
69
+ def as_json(options={})
70
+ methods = options[:methods] || []
71
+ if options[:only]
72
+ options[:methods] = Array.wrap(options[:only]).sort + methods
73
+ else
74
+ options[:methods] = attributes.keys.sort + methods
75
+ end
76
+ options[:only] = []
77
+
78
+ super(options)
79
+ end
80
+ end
81
+ CODE
82
+ end
83
+
23
84
  inject_into_class 'app/models/user.rb', 'User' do
24
85
  <<-CODE
86
+ include ExactOrderAsJson
25
87
  has_many :repos
26
88
  validates :name, presence: true
27
89
  CODE
28
90
  end
29
91
 
92
+ inject_into_class 'app/models/repo.rb', 'Repo' do
93
+ <<-CODE
94
+ include ExactOrderAsJson
95
+ validates :name, presence: true
96
+ CODE
97
+ end
98
+
30
99
  file 'app/controllers/application_controller.rb', 'ApplicationController', force: true do
31
100
  <<-CODE
32
101
  class ApplicationController < ActionController::Base
@@ -38,6 +107,14 @@ file 'app/controllers/application_controller.rb', 'ApplicationController', force
38
107
  def set_format
39
108
  request.format = :json
40
109
  end
110
+
111
+ def scoped(klass)
112
+ if klass.respond_to?(:scoped) # Rails3
113
+ klass.scoped
114
+ else
115
+ klass.all
116
+ end
117
+ end
41
118
  end
42
119
  CODE
43
120
  end
@@ -46,7 +123,7 @@ file 'app/controllers/api/v1/users_controller.rb', 'Api::V1::UsersController', f
46
123
  <<-CODE
47
124
  class Api::V1::UsersController < ApplicationController
48
125
  def index
49
- @users = User.all
126
+ @users = scoped(User)
50
127
  if (limit = params[:limit]).to_s.match(/\\d+/)
51
128
  @users = @users.limit(limit.to_i)
52
129
  end
@@ -58,15 +135,15 @@ file 'app/controllers/api/v1/users_controller.rb', 'Api::V1::UsersController', f
58
135
  if @user.save
59
136
  render json: @user
60
137
  else
61
- render json: { errors: @user.errors }
138
+ render json: { errors: @user.errors }, status: :bad_request
62
139
  end
63
140
  end
64
141
 
65
142
  def update
66
- if user.update(user_params)
143
+ if user.update_attributes(user_params)
67
144
  render json: user
68
145
  else
69
- render json: { errors: user.errors }
146
+ render json: { errors: user.errors }, status: :bad_request
70
147
  end
71
148
  end
72
149
 
@@ -114,20 +191,20 @@ file 'app/controllers/api/v1/repos_controller.rb', 'Api::V1::ReposController', f
114
191
  if @repo.save
115
192
  render json: @repo.to_json(include: 'user', except: 'user_id')
116
193
  else
117
- render json: { errors: @repo.errors }, status: 401
194
+ render json: { errors: @repo.errors }, status: :bad_request
118
195
  end
119
196
  end
120
197
 
121
198
  def show
122
- render json: Repo.find(params[:id])
199
+ render json: repo
123
200
  end
124
201
 
125
202
  def update
126
- @repo = user.repos.find(params[:id])
127
- if @repo.update(repo_params)
203
+ @repo = repo
204
+ if @repo.update_attributes(repo_params)
128
205
  render json: @repo
129
206
  else
130
- render json: { errors: @repo.errors }
207
+ render json: { errors: @repo.errors }, status: :bad_request
131
208
  end
132
209
  end
133
210
 
@@ -139,6 +216,10 @@ file 'app/controllers/api/v1/repos_controller.rb', 'Api::V1::ReposController', f
139
216
 
140
217
  private
141
218
 
219
+ def repo
220
+ @repo ||= (user.repos.find_by_name(params[:id]) || user.repos.find(params[:id]))
221
+ end
222
+
142
223
  def user
143
224
  @user ||= (User.find_by_name(params[:user_id]) || User.find(params[:user_id]))
144
225
  end
@@ -224,20 +305,28 @@ file 'lib/tasks/db.rake', force: true do
224
305
  namespace :db do
225
306
  desc 'fills in data'
226
307
  task :import => :environment do
227
- User.find_or_create_by!(name: "razum2um").repos.find_or_create_by!(name: "lurker")
228
- User.find_or_create_by!(name: "razum2um").repos.find_or_create_by!(name: "resque-kalashnikov")
229
- User.find_or_create_by!(name: "razum2um").repos.find_or_create_by!(name: "mutli_schema")
308
+ User.where(name: "razum2um").first_or_create.repos.where(name: "lurker").first_or_create
309
+ User.where(name: "razum2um").first_or_create.repos.where(name: "resque-kalashnikov").first_or_create
310
+ User.where(name: "razum2um").first_or_create.repos.where(name: "mutli_schema").first_or_create
230
311
  end
231
312
  end
232
313
  CODE
233
314
  end
234
315
 
235
- run 'bin/rake db:drop'
236
- run 'bin/rake db:create'
237
- run 'bin/rake db:migrate'
238
- run 'bin/rake db:import'
316
+ file 'db/schema.rb', force: true do
317
+ <<-CODE
318
+ ActiveRecord::Schema.define do
319
+ create_table "repos", :force => true do |t|
320
+ t.integer "user_id"
321
+ t.string "name"
322
+ end
239
323
 
240
- run 'RAILS_ENV=test bin/rake db:drop'
241
- run 'RAILS_ENV=test bin/rake db:create'
242
- run 'RAILS_ENV=test bin/rake db:migrate'
324
+ add_index "repos", ["user_id"], :name => "index_repos_on_user_id"
325
+
326
+ create_table "users", :force => true do |t|
327
+ t.string "name"
328
+ end
329
+ end
330
+ CODE
331
+ end
243
332
 
@@ -1,8 +1,3 @@
1
- file '.bundle/config', <<-CODE
2
- ---
3
- BUNDLE_PATH: #{File.expand_path '../../vendor/bundle', __FILE__}
4
- CODE
5
-
6
1
  gem 'rspec-rails'
7
2
  gem 'spring-commands-rspec'
8
3
  gem 'database_cleaner'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lurker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Bokov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -126,16 +126,22 @@ dependencies:
126
126
  name: rails
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '3.2'
132
+ - - "<"
130
133
  - !ruby/object:Gem::Version
131
- version: '4.1'
134
+ version: '4.2'
132
135
  type: :development
133
136
  prerelease: false
134
137
  version_requirements: !ruby/object:Gem::Requirement
135
138
  requirements:
136
- - - "~>"
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '3.2'
142
+ - - "<"
137
143
  - !ruby/object:Gem::Version
138
- version: '4.1'
144
+ version: '4.2'
139
145
  - !ruby/object:Gem::Dependency
140
146
  name: rake
141
147
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +212,20 @@ dependencies:
206
212
  - - "~>"
207
213
  - !ruby/object:Gem::Version
208
214
  version: '2.2'
215
+ - !ruby/object:Gem::Dependency
216
+ name: nokogiri
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: 1.5.11
222
+ type: :development
223
+ prerelease: false
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: 1.5.11
209
229
  - !ruby/object:Gem::Dependency
210
230
  name: poltergeist
211
231
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +324,6 @@ files:
304
324
  - ".rspec"
305
325
  - ".travis.yml"
306
326
  - Gemfile
307
- - Gemfile.ci
308
327
  - LICENSE.txt
309
328
  - README.md
310
329
  - Rakefile
@@ -322,8 +341,12 @@ files:
322
341
  - features/request_specs/nested_schema_scaffolding.feature
323
342
  - features/request_specs/readme.md
324
343
  - features/request_specs/schema_scaffolding.feature
344
+ - features/request_specs/schema_suffixes.feature
325
345
  - features/step_definitions/additional_cli_steps.rb
326
346
  - features/support/env.rb
347
+ - gemfiles/Gemfile32.ci
348
+ - gemfiles/Gemfile40.ci
349
+ - gemfiles/Gemfile41.ci
327
350
  - lib/endpoint-schema.yaml
328
351
  - lib/lurker.rb
329
352
  - lib/lurker/capistrano.rb
@@ -335,11 +358,9 @@ files:
335
358
  - lib/lurker/erb_schema_context.rb
336
359
  - lib/lurker/form_builder.rb
337
360
  - lib/lurker/jaml_descriptor.rb
338
- - lib/lurker/meta_service.rb
339
361
  - lib/lurker/presenters/base_presenter.rb
340
362
  - lib/lurker/presenters/endpoint_presenter.rb
341
363
  - lib/lurker/presenters/json_presenter.rb
342
- - lib/lurker/presenters/meta_service_presenter.rb
343
364
  - lib/lurker/presenters/response_code_presenter.rb
344
365
  - lib/lurker/presenters/schema_presenter.rb
345
366
  - lib/lurker/presenters/service_presenter.rb
@@ -353,8 +374,6 @@ files:
353
374
  - lib/lurker/spec_watcher.rb
354
375
  - lib/lurker/tasks/capistrano.rake
355
376
  - lib/lurker/templates/bootstrap.css.map
356
- - lib/lurker/templates/endpoint.html.erb
357
- - lib/lurker/templates/endpoint.md.erb
358
377
  - lib/lurker/templates/fonts/FontAwesome.otf
359
378
  - lib/lurker/templates/fonts/fontawesome-webfont.eot
360
379
  - lib/lurker/templates/fonts/fontawesome-webfont.svg
@@ -366,21 +385,9 @@ files:
366
385
  - lib/lurker/templates/fonts/glyphicons-halflings-regular.woff
367
386
  - lib/lurker/templates/javascripts/JSXTransformer.js
368
387
  - lib/lurker/templates/javascripts/application.js
369
- - lib/lurker/templates/javascripts/demo/dashboard-demo.js
370
- - lib/lurker/templates/javascripts/demo/flot-demo.js
371
- - lib/lurker/templates/javascripts/demo/morris-demo.js
372
388
  - lib/lurker/templates/javascripts/lurker.js
373
389
  - lib/lurker/templates/javascripts/phantomjs-shims.js
374
- - lib/lurker/templates/javascripts/plugins/dataTables/dataTables.bootstrap.js
375
- - lib/lurker/templates/javascripts/plugins/dataTables/jquery.dataTables.js
376
- - lib/lurker/templates/javascripts/plugins/flot/excanvas.min.js
377
- - lib/lurker/templates/javascripts/plugins/flot/jquery.flot.js
378
- - lib/lurker/templates/javascripts/plugins/flot/jquery.flot.pie.js
379
- - lib/lurker/templates/javascripts/plugins/flot/jquery.flot.resize.js
380
- - lib/lurker/templates/javascripts/plugins/flot/jquery.flot.tooltip.min.js
381
390
  - lib/lurker/templates/javascripts/plugins/metisMenu/jquery.metisMenu.js
382
- - lib/lurker/templates/javascripts/plugins/morris/morris.js
383
- - lib/lurker/templates/javascripts/plugins/morris/raphael-2.1.0.min.js
384
391
  - lib/lurker/templates/javascripts/prettify.js
385
392
  - lib/lurker/templates/javascripts/react-catalyst.js
386
393
  - lib/lurker/templates/javascripts/react-with-addons.js
@@ -390,7 +397,6 @@ files:
390
397
  - lib/lurker/templates/layouts/_sidesearch.html.erb
391
398
  - lib/lurker/templates/layouts/application.html.erb
392
399
  - lib/lurker/templates/lurker/rendering/_breadcrumb.html.erb
393
- - lib/lurker/templates/lurker/rendering/_endpoint.html.erb
394
400
  - lib/lurker/templates/lurker/rendering/_information_warning_li.html.erb
395
401
  - lib/lurker/templates/lurker/rendering/_left_menu.html.erb
396
402
  - lib/lurker/templates/lurker/rendering/_param_form_element.html.erb
@@ -400,7 +406,6 @@ files:
400
406
  - lib/lurker/templates/lurker/rendering/_undefined_route.html.erb
401
407
  - lib/lurker/templates/lurker/rendering/index.html.erb
402
408
  - lib/lurker/templates/lurker/rendering/show.html.erb
403
- - lib/lurker/templates/meta_service.html.erb
404
409
  - lib/lurker/templates/meta_service.md.erb
405
410
  - lib/lurker/templates/public/application.css
406
411
  - lib/lurker/templates/public/application.js
@@ -414,18 +419,11 @@ files:
414
419
  - lib/lurker/templates/public/fonts/glyphicons-halflings-regular.svg
415
420
  - lib/lurker/templates/public/fonts/glyphicons-halflings-regular.ttf
416
421
  - lib/lurker/templates/public/fonts/glyphicons-halflings-regular.woff
417
- - lib/lurker/templates/service.html.erb
418
- - lib/lurker/templates/service.md.erb
419
422
  - lib/lurker/templates/shared/endpoint_name.html.erb
420
423
  - lib/lurker/templates/shared/endpoint_name.md.erb
421
- - lib/lurker/templates/styles.css
422
424
  - lib/lurker/templates/stylesheets/application.css
423
425
  - lib/lurker/templates/stylesheets/bootstrap.css
424
426
  - lib/lurker/templates/stylesheets/font-awesome/css/font-awesome.css
425
- - lib/lurker/templates/stylesheets/plugins/dataTables/dataTables.bootstrap.css
426
- - lib/lurker/templates/stylesheets/plugins/morris/morris-0.4.3.min.css
427
- - lib/lurker/templates/stylesheets/plugins/social-buttons/social-buttons.css
428
- - lib/lurker/templates/stylesheets/plugins/timeline/timeline.css
429
427
  - lib/lurker/templates/stylesheets/prettify-desert.css
430
428
  - lib/lurker/templates/stylesheets/prettify.css
431
429
  - lib/lurker/templates/stylesheets/sb-admin.css
@@ -475,6 +473,7 @@ test_files:
475
473
  - features/request_specs/nested_schema_scaffolding.feature
476
474
  - features/request_specs/readme.md
477
475
  - features/request_specs/schema_scaffolding.feature
476
+ - features/request_specs/schema_suffixes.feature
478
477
  - features/step_definitions/additional_cli_steps.rb
479
478
  - features/support/env.rb
480
479
  - spec/lurker/endpoint_spec.rb
metadata.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG v1
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABCgAGBQJTYSdDAAoJENcoxKfNVdjbTd0H/ikPlNf2LUQtakmpxDMxCZKo
6
- iT3v87Ssz07yZcgt8wZDF64rVBZZ1yM2bssQftCLOvVqKGzXzlemwp7dO4m2hcBE
7
- 8QoeueyTieMo9gN+p2/sNk3RaMwsUy4X24Q1ZSUdBiez/K8QPnjSnSeReVHBwI3X
8
- GDag9EdC+i79eTM+/06Ab5ReY4Wxn7w5pxRATWFrv4s0r3yElaOaARQQbH2RLe66
9
- KCkKSmh6QVG3f08rRkvnXyx0CbpQqSIxz6jN696z1PfeWecRBs9LYfxRSM/0BgCW
10
- KDSFDju69n2mNdGKNsOIicpguq8RNlG+7o3JzYyPru/4qEZfDS4uFsnZIuPxSfE=
11
- =kKPC
5
+ iQEcBAABCgAGBQJTaesfAAoJENcoxKfNVdjbgroIANLWxjOTNAIIaj4XzR6jJzfv
6
+ CVWJ5D2BOqOOq5F6gU5fGJsvpaMVfNY/NcVj5sXSzFI/PBs136EVMNgyJNOEVhTa
7
+ KyjRiplG/LYgvBjGkuWuuv3KSTLbOcH3kRCKmzeJOZftCeUtS09YNX9+RrGlMFyE
8
+ oCH05lp3VPHyTFQ6fo1l+c+9EBe8SzoEFy8Qpzizw+tIGx2GaKxp98Kc1NGw/4Ak
9
+ zJmnEno9iCjXAAqhl7JmGAMj0oB1lZ3v2OCgkC614BMdSQ4NxvoNojQuKxB3Lbc1
10
+ VVibMrzBXEN2vHROLvgQ9SIb9+POxdbc8bpS7oM5CO1wBZVANNurjfWVFr1RwZM=
11
+ =o0r3
12
12
  -----END PGP SIGNATURE-----
@@ -1,46 +0,0 @@
1
- require 'yaml'
2
-
3
- # MetaServices are collections of services
4
- class Lurker::MetaService
5
- attr_reader :meta_service_dir
6
-
7
- def initialize(meta_service_dir)
8
- @meta_service_dir = File.expand_path(meta_service_dir)
9
-
10
- service_path = Dir["#{meta_service_dir}/*.lurker.meta"].first
11
- @schema = if service_path
12
- YAML.load_file(service_path)
13
- else
14
- {}
15
- end
16
- end
17
-
18
- def empty?
19
- @schema.empty?
20
- end
21
-
22
- def services
23
- @schema['services'].map do |path|
24
- service_path = if path.start_with?('/') || path.start_with?('~')
25
- path
26
- else
27
- File.join(meta_service_dir, path)
28
- end
29
- serv = Lurker::Service.new(service_path)
30
- serv.meta_service = self
31
- serv
32
- end
33
- end
34
-
35
- def name
36
- @schema['name']
37
- end
38
-
39
- def description
40
- @schema['description']
41
- end
42
-
43
- def discussion
44
- @schema['discussion']
45
- end
46
- end