popolo 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +41 -0
  3. data/Rakefile +16 -0
  4. data/app/assets/javascripts/popolo/application.js +13 -0
  5. data/app/assets/stylesheets/popolo/application.css +13 -0
  6. data/app/controllers/popolo/areas_controller.rb +48 -0
  7. data/app/controllers/popolo/organizations_controller.rb +48 -0
  8. data/app/controllers/popolo/people_controller.rb +12 -0
  9. data/app/controllers/popolo/posts_controller.rb +12 -0
  10. data/app/controllers/popolo_controller.rb +3 -0
  11. data/app/helpers/popolo_helper.rb +10 -0
  12. data/app/models/popolo/address.rb +27 -0
  13. data/app/models/popolo/area.rb +25 -0
  14. data/app/models/popolo/event.rb +46 -0
  15. data/app/models/popolo/identifier.rb +15 -0
  16. data/app/models/popolo/link.rb +16 -0
  17. data/app/models/popolo/membership.rb +25 -0
  18. data/app/models/popolo/organization.rb +32 -0
  19. data/app/models/popolo/other_name.rb +21 -0
  20. data/app/models/popolo/person.rb +49 -0
  21. data/app/models/popolo/post.rb +25 -0
  22. data/app/models/popolo/source.rb +29 -0
  23. data/app/views/popolo/areas/index.html.erb +1 -0
  24. data/app/views/popolo/areas/show.html.erb +1 -0
  25. data/app/views/popolo/areas_or_organizations/_index.html.erb +31 -0
  26. data/app/views/popolo/areas_or_organizations/_show.html.erb +30 -0
  27. data/app/views/popolo/organizations/index.html.erb +1 -0
  28. data/app/views/popolo/organizations/show.html.erb +1 -0
  29. data/app/views/popolo/people/index.html.erb +0 -0
  30. data/app/views/popolo/people/show.html.erb +0 -0
  31. data/app/views/popolo/posts/index.html.erb +0 -0
  32. data/app/views/popolo/posts/show.html.erb +0 -0
  33. data/config/routes.rb +15 -0
  34. data/lib/generators/popolo_generator.rb +36 -0
  35. data/lib/generators/templates/README +7 -0
  36. data/lib/popolo/engine.rb +7 -0
  37. data/lib/popolo/mixins/eventable.rb +15 -0
  38. data/lib/popolo/mixins/sluggable.rb +64 -0
  39. data/lib/popolo/version.rb +3 -0
  40. data/lib/popolo.rb +18 -0
  41. data/spec/controllers/popolo/areas_controller_spec.rb +59 -0
  42. data/spec/controllers/popolo/organizations_controller_spec.rb +59 -0
  43. data/spec/controllers/popolo/people_controller_spec.rb +30 -0
  44. data/spec/controllers/popolo/posts_controller_spec.rb +30 -0
  45. data/spec/controllers/popolo_controller_spec.rb +4 -0
  46. data/spec/dummy/Rakefile +7 -0
  47. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  48. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  49. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  50. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  51. data/spec/dummy/app/models/cat.rb +6 -0
  52. data/spec/dummy/app/models/dog.rb +10 -0
  53. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  54. data/spec/dummy/config/application.rb +62 -0
  55. data/spec/dummy/config/boot.rb +10 -0
  56. data/spec/dummy/config/environment.rb +5 -0
  57. data/spec/dummy/config/environments/development.rb +37 -0
  58. data/spec/dummy/config/environments/production.rb +67 -0
  59. data/spec/dummy/config/environments/test.rb +37 -0
  60. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  61. data/spec/dummy/config/initializers/session_store.rb +8 -0
  62. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  63. data/spec/dummy/config/locales/en.yml +5 -0
  64. data/spec/dummy/config/mongoid.yml +68 -0
  65. data/spec/dummy/config/routes.rb +3 -0
  66. data/spec/dummy/config.ru +4 -0
  67. data/spec/dummy/log/development.log +6 -0
  68. data/spec/dummy/log/test.log +35513 -0
  69. data/spec/dummy/public/404.html +26 -0
  70. data/spec/dummy/public/422.html +26 -0
  71. data/spec/dummy/public/500.html +25 -0
  72. data/spec/dummy/public/favicon.ico +0 -0
  73. data/spec/dummy/script/rails +6 -0
  74. data/spec/factories.rb +25 -0
  75. data/spec/helpers/popolo_helper_spec.rb +4 -0
  76. data/spec/models/popolo/address_spec.rb +4 -0
  77. data/spec/models/popolo/area_spec.rb +4 -0
  78. data/spec/models/popolo/event_spec.rb +7 -0
  79. data/spec/models/popolo/identifier_spec.rb +5 -0
  80. data/spec/models/popolo/link_spec.rb +5 -0
  81. data/spec/models/popolo/membership_spec.rb +27 -0
  82. data/spec/models/popolo/organization_spec.rb +25 -0
  83. data/spec/models/popolo/other_name_spec.rb +25 -0
  84. data/spec/models/popolo/person_spec.rb +25 -0
  85. data/spec/models/popolo/post_spec.rb +5 -0
  86. data/spec/models/popolo/source_spec.rb +7 -0
  87. data/spec/popolo/mixins/sluggable_spec.rb +153 -0
  88. data/spec/popolo_spec.rb +4 -0
  89. data/spec/routing/popolo/areas_routing_spec.rb +29 -0
  90. data/spec/routing/popolo/organizations_routing_spec.rb +29 -0
  91. data/spec/routing/popolo/people_routing_spec.rb +21 -0
  92. data/spec/routing/popolo/posts_routing_spec.rb +21 -0
  93. data/spec/spec_helper.rb +81 -0
  94. metadata +416 -0
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '60e574df86e3e907b71cc35d7f1ab16aaa54c4d4495bd927b9d2c2fed56b1efb23cb7150c01a43b7ecf9e2eb141050c666169f126f688a5deb077d2a1ed566d3'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,68 @@
1
+ development:
2
+ # Configure available database sessions. (required)
3
+ sessions:
4
+ # Defines the default session. (required)
5
+ default:
6
+ # Defines the name of the default database that Mongoid can connect to.
7
+ # (required).
8
+ database: popolo_development
9
+ # Provides the hosts the default session can connect to. Must be an array
10
+ # of host:port pairs. (required)
11
+ hosts:
12
+ - localhost:27017
13
+ options:
14
+ # Change whether the session persists in safe mode by default.
15
+ # (default: false)
16
+ # safe: false
17
+
18
+ # Change the default consistency model to :eventual or :strong.
19
+ # :eventual will send reads to secondaries, :strong sends everything
20
+ # to master. (default: :eventual)
21
+ consistency: :strong
22
+ # Configure Mongoid specific options. (optional)
23
+ options:
24
+ # Configuration for whether or not to allow access to fields that do
25
+ # not have a field definition on the model. (default: true)
26
+ # allow_dynamic_fields: true
27
+
28
+ # Enable the identity map, needed for eager loading. (default: false)
29
+ identity_map_enabled: true
30
+
31
+ # Includes the root model name in json serialization. (default: false)
32
+ # include_root_in_json: false
33
+
34
+ # Include the _type field in serializaion. (default: false)
35
+ # include_type_for_serialization: false
36
+
37
+ # Preload all models in development, needed when models use
38
+ # inheritance. (default: false)
39
+ # preload_models: false
40
+
41
+ # Protect id and type from mass assignment. (default: true)
42
+ # protect_sensitive_fields: true
43
+
44
+ # Raise an error when performing a #find and the document is not found.
45
+ # (default: true)
46
+ # raise_not_found_error: true
47
+
48
+ # Raise an error when defining a scope with the same name as an
49
+ # existing method. (default: false)
50
+ # scope_overwrite_exception: false
51
+
52
+ # Skip the database version check, used when connecting to a db without
53
+ # admin access. (default: false)
54
+ # skip_version_check: false
55
+
56
+ # User Active Support's time zone in conversions. (default: true)
57
+ # use_activesupport_time_zone: true
58
+
59
+ # Ensure all times are UTC in the app side. (default: false)
60
+ # use_utc: false
61
+ test:
62
+ sessions:
63
+ default:
64
+ database: popolo_test
65
+ hosts:
66
+ - localhost:27017
67
+ options:
68
+ consistency: :strong
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Popolo::Engine => '/popolo'
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,6 @@
1
+ MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.4269ms)
2
+ MOPED: 127.0.0.1:27017 INSERT database=popolo_development collection=popolo_people documents=[{"_id"=>"50f305f223e2f6045a000001", "name"=>{"en"=>"John Doe"}, "slug"=>"john-doe", "updated_at"=>2013-01-13 19:07:30 UTC, "created_at"=>2013-01-13 19:07:30 UTC}] flags=[] (0.2322ms)
3
+ MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.0641ms)
4
+ MOPED: 127.0.0.1:27017 QUERY database=popolo_development collection=popolo_people selector={"$query"=>{"deleted_at"=>nil}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 fields=nil (0.7071ms)
5
+ MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (0.6180ms)
6
+ MOPED: 127.0.0.1:27017 QUERY database=popolo_development collection=popolo_people selector={"$query"=>{"deleted_at"=>nil}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 fields=nil (0.7722ms)