crowdblog 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/.gitignore +12 -0
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -0
  4. data/.simplecov +13 -0
  5. data/Gemfile +35 -0
  6. data/Gemfile.lock +291 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.rdoc +3 -0
  9. data/Rakefile +32 -0
  10. data/app/assets/images/crowdblog/.gitkeep +0 -0
  11. data/app/assets/images/crowdblog/logo.png +0 -0
  12. data/app/assets/javascripts/crowdblog/models/post.js.coffee +11 -0
  13. data/app/assets/javascripts/crowdblog/posts_main.js.coffee +42 -0
  14. data/app/assets/javascripts/crowdblog/templates/posts/attachment.jst.eco +1 -0
  15. data/app/assets/javascripts/crowdblog/templates/posts/edit.jst.eco +38 -0
  16. data/app/assets/javascripts/crowdblog/templates/posts/index.jst.eco +17 -0
  17. data/app/assets/javascripts/crowdblog/templates/posts/post.jst.eco +27 -0
  18. data/app/assets/javascripts/crowdblog/views/posts/attachment_view.js.coffee +8 -0
  19. data/app/assets/javascripts/crowdblog/views/posts/edit_post_view.js.coffee +41 -0
  20. data/app/assets/javascripts/crowdblog/views/posts/index.js.coffee +28 -0
  21. data/app/assets/javascripts/crowdblog/views/posts/post_view.js.coffee +40 -0
  22. data/app/assets/javascripts/crowdblog/xhr_fix.js.coffee +4 -0
  23. data/app/assets/javascripts/crowdblog.js +16 -0
  24. data/app/assets/stylesheets/crowdblog/posts.css.scss +3 -0
  25. data/app/assets/stylesheets/crowdblog.css +7 -0
  26. data/app/controllers/crowdblog/application_controller.rb +16 -0
  27. data/app/controllers/crowdblog/assets_controller.rb +14 -0
  28. data/app/controllers/crowdblog/authors_controller.rb +9 -0
  29. data/app/controllers/crowdblog/posts_controller.rb +48 -0
  30. data/app/controllers/crowdblog/sessions_controller.rb +25 -0
  31. data/app/controllers/crowdblog/users/omniauth_callbacks_controller.rb +21 -0
  32. data/app/helpers/crowdblog/application_helper.rb +4 -0
  33. data/app/models/crowdblog/asset.rb +8 -0
  34. data/app/models/crowdblog/post.rb +121 -0
  35. data/app/models/crowdblog/user.rb +32 -0
  36. data/app/sweepers/post_sweeper.rb +5 -0
  37. data/app/uploaders/attachment_uploader.rb +48 -0
  38. data/app/views/crowdblog/authors/index.html.slim +18 -0
  39. data/app/views/crowdblog/posts/index.html.slim +13 -0
  40. data/app/views/layouts/crowdblog/application.html.slim +25 -0
  41. data/config/cucumber.yml +8 -0
  42. data/config/routes.rb +14 -0
  43. data/crowdblog.gemspec +46 -0
  44. data/db/migrate/20120215232711_create_users.rb +10 -0
  45. data/db/migrate/20120216154516_add_devise_to_users.rb +56 -0
  46. data/db/migrate/20120217213920_create_posts.rb +13 -0
  47. data/db/migrate/20120219014520_add_author_to_posts.rb +6 -0
  48. data/db/migrate/20120219040607_add_state_to_post.rb +7 -0
  49. data/db/migrate/20120219071614_create_assets.rb +10 -0
  50. data/db/migrate/20120219234253_add_alias_to_users.rb +6 -0
  51. data/db/migrate/20120220033923_create_vestal_versions.rb +28 -0
  52. data/features/posts/manage_posts.feature +46 -0
  53. data/features/step_definitions/index_steps.rb +16 -0
  54. data/features/step_definitions/interaction_steps.rb +26 -0
  55. data/features/step_definitions/posts_steps.rb +35 -0
  56. data/features/step_definitions/session_steps.rb +15 -0
  57. data/features/support/env.rb +69 -0
  58. data/lib/crowdblog/engine.rb +5 -0
  59. data/lib/crowdblog/version.rb +3 -0
  60. data/lib/crowdblog.rb +4 -0
  61. data/lib/tasks/crowdblog_tasks.rake +4 -0
  62. data/script/build +29 -0
  63. data/script/cucumber +10 -0
  64. data/script/rails +8 -0
  65. data/spec/dummy/.rvmrc +1 -0
  66. data/spec/dummy/README.rdoc +261 -0
  67. data/spec/dummy/Rakefile +7 -0
  68. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  69. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  70. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  71. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  72. data/spec/dummy/app/mailers/.gitkeep +0 -0
  73. data/spec/dummy/app/models/.gitkeep +0 -0
  74. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  75. data/spec/dummy/config/application.rb +62 -0
  76. data/spec/dummy/config/boot.rb +10 -0
  77. data/spec/dummy/config/database.yml +25 -0
  78. data/spec/dummy/config/environment.rb +5 -0
  79. data/spec/dummy/config/environments/development.rb +37 -0
  80. data/spec/dummy/config/environments/production.rb +67 -0
  81. data/spec/dummy/config/environments/test.rb +37 -0
  82. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  83. data/spec/dummy/config/initializers/carrierwave.rb +18 -0
  84. data/spec/dummy/config/initializers/devise.rb +230 -0
  85. data/spec/dummy/config/initializers/inflections.rb +15 -0
  86. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  87. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  88. data/spec/dummy/config/initializers/session_store.rb +8 -0
  89. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  90. data/spec/dummy/config/locales/en.yml +5 -0
  91. data/spec/dummy/config/routes.rb +6 -0
  92. data/spec/dummy/config.ru +4 -0
  93. data/spec/dummy/db/schema.rb +76 -0
  94. data/spec/dummy/lib/assets/.gitkeep +0 -0
  95. data/spec/dummy/lib/tasks/cucumber.rake +65 -0
  96. data/spec/dummy/log/.gitkeep +0 -0
  97. data/spec/dummy/public/404.html +26 -0
  98. data/spec/dummy/public/422.html +26 -0
  99. data/spec/dummy/public/500.html +25 -0
  100. data/spec/dummy/public/favicon.ico +0 -0
  101. data/spec/dummy/script/rails +6 -0
  102. data/spec/helpers/application_helper_spec.rb +4 -0
  103. data/spec/models/post_spec.rb +94 -0
  104. data/spec/spec_helper.rb +39 -0
  105. data/vendor/assets/javascripts/jquery.uploadify.js +296 -0
  106. data/vendor/assets/javascripts/swfobject.js +4 -0
  107. metadata +428 -0
@@ -0,0 +1,62 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require
12
+ require "crowdblog"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Use SQL instead of Active Record's schema dumper when creating the database.
45
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
46
+ # like if you have constraints or database-specific column types
47
+ # config.active_record.schema_format = :sql
48
+
49
+ # Enforce whitelist mode for mass assignment.
50
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
51
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
52
+ # parameters by using an attr_accessible or attr_protected declaration.
53
+ # config.active_record.whitelist_attributes = true
54
+
55
+ # Enable the asset pipeline
56
+ config.assets.enabled = true
57
+
58
+ # Version of your assets, change this if you want to expire all your assets
59
+ config.assets.version = '1.0'
60
+ end
61
+ end
62
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,18 @@
1
+ CarrierWave.configure do |config|
2
+ if Rails.env.production?
3
+ config.storage = :fog
4
+
5
+ config.fog_credentials = {
6
+ :provider => 'AWS',
7
+ :aws_access_key_id => ENV['AWS_ACCESS_KEY'],
8
+ :aws_secret_access_key => ENV['AWS_SECRET_KEY']
9
+ #:region => 'us-east-1'
10
+ }
11
+ config.fog_directory = ENV['AWS_BUCKET']
12
+ config.fog_host = 'http://blogassets.crowdint.com'
13
+ config.fog_public = true
14
+ config.fog_attributes = {'Cache-Control' => 'max-age=315576000'}
15
+ else
16
+ config.storage = :file
17
+ end
18
+ end
@@ -0,0 +1,230 @@
1
+ #require 'openid/store/filesystem'
2
+ #
3
+ # Use this hook to configure devise mailer, warden hooks and so forth.
4
+ # Many of these configuration options can be set straight in your model.
5
+ Devise.setup do |config|
6
+ # ==> Mailer Configuration
7
+ # Configure the e-mail address which will be shown in Devise::Mailer,
8
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
9
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
10
+
11
+ # Configure the class responsible to send e-mails.
12
+ # config.mailer = "Devise::Mailer"
13
+
14
+ # Automatically apply schema changes in tableless databases
15
+ config.apply_schema = false
16
+
17
+ # ==> ORM configuration
18
+ # Load and configure the ORM. Supports :active_record (default) and
19
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
20
+ # available as additional gems.
21
+ require 'devise/orm/active_record'
22
+
23
+ # ==> Configuration for any authentication mechanism
24
+ # Configure which keys are used when authenticating a user. The default is
25
+ # just :email. You can configure it to use [:username, :subdomain], so for
26
+ # authenticating a user, both parameters are required. Remember that those
27
+ # parameters are used only when authenticating and not when retrieving from
28
+ # session. If you need permissions, you should implement that in a before filter.
29
+ # You can also supply a hash where the value is a boolean determining whether
30
+ # or not authentication should be aborted when the value is not present.
31
+ # config.authentication_keys = [ :email ]
32
+
33
+ # Configure parameters from the request object used for authentication. Each entry
34
+ # given should be a request method and it will automatically be passed to the
35
+ # find_for_authentication method and considered in your model lookup. For instance,
36
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
37
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
38
+ # config.request_keys = []
39
+
40
+ # Configure which authentication keys should be case-insensitive.
41
+ # These keys will be downcased upon creating or modifying a user and when used
42
+ # to authenticate or find a user. Default is :email.
43
+ config.case_insensitive_keys = [ :email ]
44
+
45
+ # Configure which authentication keys should have whitespace stripped.
46
+ # These keys will have whitespace before and after removed upon creating or
47
+ # modifying a user and when used to authenticate or find a user. Default is :email.
48
+ config.strip_whitespace_keys = [ :email ]
49
+
50
+ # Tell if authentication through request.params is enabled. True by default.
51
+ # It can be set to an array that will enable params authentication only for the
52
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
53
+ # enable it only for database (email + password) authentication.
54
+ # config.params_authenticatable = true
55
+
56
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
57
+ # It can be set to an array that will enable http authentication only for the
58
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
59
+ # enable it only for token authentication.
60
+ # config.http_authenticatable = false
61
+
62
+ # If http headers should be returned for AJAX requests. True by default.
63
+ # config.http_authenticatable_on_xhr = true
64
+
65
+ # The realm used in Http Basic Authentication. "Application" by default.
66
+ # config.http_authentication_realm = "Application"
67
+
68
+ # It will change confirmation, password recovery and other workflows
69
+ # to behave the same regardless if the e-mail provided was right or wrong.
70
+ # Does not affect registerable.
71
+ # config.paranoid = true
72
+
73
+ # By default Devise will store the user in session. You can skip storage for
74
+ # :http_auth and :token_auth by adding those symbols to the array below.
75
+ # Notice that if you are skipping storage for all authentication paths, you
76
+ # may want to disable generating routes to Devise's sessions controller by
77
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
78
+ config.skip_session_storage = [:http_auth]
79
+
80
+ # ==> Configuration for :database_authenticatable
81
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
82
+ # using other encryptors, it sets how many times you want the password re-encrypted.
83
+ #
84
+ # Limiting the stretches to just one in testing will increase the performance of
85
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
86
+ # a value less than 10 in other environments.
87
+ config.stretches = Rails.env.test? ? 1 : 10
88
+
89
+ # Setup a pepper to generate the encrypted password.
90
+ # config.pepper = "6c7957fc3416ab1f88702c4ee999fe69bfc0ec4677e8e6429a6eba5c3c13225a072dc8fc63a7af8b82851f4aebd11612bffbcfd9247c9c3bd8d66cf6b3c8e4d6"
91
+
92
+ # ==> Configuration for :confirmable
93
+ # A period that the user is allowed to access the website even without
94
+ # confirming his account. For instance, if set to 2.days, the user will be
95
+ # able to access the website for two days without confirming his account,
96
+ # access will be blocked just in the third day. Default is 0.days, meaning
97
+ # the user cannot access the website without confirming his account.
98
+ # config.allow_unconfirmed_access_for = 2.days
99
+
100
+ # If true, requires any email changes to be confirmed (exctly the same way as
101
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
102
+ # db field (see migrations). Until confirmed new email is stored in
103
+ # unconfirmed email column, and copied to email column on successful confirmation.
104
+ config.reconfirmable = true
105
+
106
+ # Defines which key will be used when confirming an account
107
+ # config.confirmation_keys = [ :email ]
108
+
109
+ # ==> Configuration for :rememberable
110
+ # The time the user will be remembered without asking for credentials again.
111
+ # config.remember_for = 2.weeks
112
+
113
+ # If true, extends the user's remember period when remembered via cookie.
114
+ # config.extend_remember_period = false
115
+
116
+ # If true, uses the password salt as remember token. This should be turned
117
+ # to false if you are not using database authenticatable.
118
+ config.use_salt_as_remember_token = true
119
+
120
+ # Options to be passed to the created cookie. For instance, you can set
121
+ # :secure => true in order to force SSL only cookies.
122
+ # config.cookie_options = {}
123
+
124
+ # ==> Configuration for :validatable
125
+ # Range for password length. Default is 6..128.
126
+ # config.password_length = 6..128
127
+
128
+ # Email regex used to validate email formats. It simply asserts that
129
+ # an one (and only one) @ exists in the given string. This is mainly
130
+ # to give user feedback and not to assert the e-mail validity.
131
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
132
+
133
+ # ==> Configuration for :timeoutable
134
+ # The time you want to timeout the user session without activity. After this
135
+ # time the user will be asked for credentials again. Default is 30 minutes.
136
+ # config.timeout_in = 30.minutes
137
+
138
+ # ==> Configuration for :lockable
139
+ # Defines which strategy will be used to lock an account.
140
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
141
+ # :none = No lock strategy. You should handle locking by yourself.
142
+ # config.lock_strategy = :failed_attempts
143
+
144
+ # Defines which key will be used when locking and unlocking an account
145
+ # config.unlock_keys = [ :email ]
146
+
147
+ # Defines which strategy will be used to unlock an account.
148
+ # :email = Sends an unlock link to the user email
149
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
150
+ # :both = Enables both strategies
151
+ # :none = No unlock strategy. You should handle unlocking by yourself.
152
+ # config.unlock_strategy = :both
153
+
154
+ # Number of authentication tries before locking an account if lock_strategy
155
+ # is failed attempts.
156
+ # config.maximum_attempts = 20
157
+
158
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
159
+ # config.unlock_in = 1.hour
160
+
161
+ # ==> Configuration for :recoverable
162
+ #
163
+ # Defines which key will be used when recovering the password for an account
164
+ # config.reset_password_keys = [ :email ]
165
+
166
+ # Time interval you can reset your password with a reset password key.
167
+ # Don't put a too small interval or your users won't have the time to
168
+ # change their passwords.
169
+ config.reset_password_within = 6.hours
170
+
171
+ # ==> Configuration for :encryptable
172
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
173
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
174
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
175
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
176
+ # REST_AUTH_SITE_KEY to pepper)
177
+ # config.encryptor = :sha512
178
+
179
+ # ==> Configuration for :token_authenticatable
180
+ # Defines name of the authentication token params key
181
+ config.token_authentication_key = :auth_token
182
+
183
+ # ==> Scopes configuration
184
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
185
+ # "users/sessions/new". It's turned off by default because it's slower if you
186
+ # are using only default views.
187
+ # config.scoped_views = false
188
+
189
+ # Configure the default scope given to Warden. By default it's the first
190
+ # devise role declared in your routes (usually :user).
191
+ # config.default_scope = :user
192
+
193
+ # Configure sign_out behavior.
194
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
195
+ # The default is true, which means any logout action will sign out all active scopes.
196
+ # config.sign_out_all_scopes = true
197
+
198
+ # ==> Navigation configuration
199
+ # Lists the formats that should be treated as navigational. Formats like
200
+ # :html, should redirect to the sign in page when the user does not have
201
+ # access, but formats like :xml or :json, should return 401.
202
+ #
203
+ # If you have any extra navigational formats, like :iphone or :mobile, you
204
+ # should add them to the navigational formats lists.
205
+ #
206
+ # The "*/*" below is required to match Internet Explorer requests.
207
+ # config.navigational_formats = ["*/*", :html]
208
+
209
+ # The default HTTP method used to sign out a resource. Default is :delete.
210
+ config.sign_out_via = :get
211
+
212
+ # ==> OmniAuth
213
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
214
+ # up on your models and hooks.
215
+ #config.omniauth :google_oauth2, '289799840893.apps.googleusercontent.com', '6DYqOtdhC8S5WARlkiOwS3zb'
216
+ config.omniauth :google_oauth2, ENV['GOOGLE_APP_ID'], ENV['GOOGLE_SECRET_KEY'],
217
+ {:client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
218
+
219
+ config.omniauth :google_apps, :domain => 'crowdint.com'
220
+
221
+
222
+ # ==> Warden configuration
223
+ # If you want to use other strategies, that are not supported by Devise, or
224
+ # change the failure app, you can configure them inside the config.warden block.
225
+ #
226
+ # config.warden do |manager|
227
+ # manager.intercept_401 = false
228
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
229
+ # end
230
+ end
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -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 = '5fab47b4592ddd02fdb39f636a2b775ba56e32bd3f9850b836e3d1678a5dc6fcd4626b30f72aaff98721394080da89fd8aa9560933257cbb3a358cce8c6fcd35'
@@ -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,6 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount Crowdblog::Engine => '/admin'
4
+
5
+ root to: 'crowdblog/posts#index'
6
+ 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,76 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20120220033923) do
15
+
16
+ create_table "assets", :force => true do |t|
17
+ t.integer "post_id"
18
+ t.string "attachment"
19
+ t.datetime "created_at", :null => false
20
+ t.datetime "updated_at", :null => false
21
+ end
22
+
23
+ create_table "posts", :force => true do |t|
24
+ t.string "title"
25
+ t.text "body"
26
+ t.string "permalink"
27
+ t.date "published_at"
28
+ t.datetime "created_at", :null => false
29
+ t.datetime "updated_at", :null => false
30
+ t.integer "author_id"
31
+ t.string "state"
32
+ t.integer "publisher_id"
33
+ end
34
+
35
+ create_table "users", :force => true do |t|
36
+ t.string "name"
37
+ t.boolean "is_publisher"
38
+ t.datetime "created_at", :null => false
39
+ t.datetime "updated_at", :null => false
40
+ t.string "email", :default => "", :null => false
41
+ t.string "encrypted_password", :default => "", :null => false
42
+ t.datetime "remember_created_at"
43
+ t.integer "sign_in_count", :default => 0
44
+ t.datetime "current_sign_in_at"
45
+ t.datetime "last_sign_in_at"
46
+ t.string "current_sign_in_ip"
47
+ t.string "last_sign_in_ip"
48
+ t.string "authentication_token"
49
+ t.string "gravatar_alias"
50
+ end
51
+
52
+ add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
53
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
54
+
55
+ create_table "versions", :force => true do |t|
56
+ t.integer "versioned_id"
57
+ t.string "versioned_type"
58
+ t.integer "user_id"
59
+ t.string "user_type"
60
+ t.string "user_name"
61
+ t.text "modifications"
62
+ t.integer "number"
63
+ t.integer "reverted_from"
64
+ t.string "tag"
65
+ t.datetime "created_at", :null => false
66
+ t.datetime "updated_at", :null => false
67
+ end
68
+
69
+ add_index "versions", ["created_at"], :name => "index_versions_on_created_at"
70
+ add_index "versions", ["number"], :name => "index_versions_on_number"
71
+ add_index "versions", ["tag"], :name => "index_versions_on_tag"
72
+ add_index "versions", ["user_id", "user_type"], :name => "index_versions_on_user_id_and_user_type"
73
+ add_index "versions", ["user_name"], :name => "index_versions_on_user_name"
74
+ add_index "versions", ["versioned_id", "versioned_type"], :name => "index_versions_on_versioned_id_and_versioned_type"
75
+
76
+ end
File without changes