cadenero 0.0.1 → 0.0.2.a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/MIT-LICENSE +2 -2
  2. data/README.md +3 -0
  3. data/app/models/cadenero/v1/account.rb +1 -1
  4. data/db/migrate/20130612061604_create_cadenero_v1_accounts.rb +2 -0
  5. data/db/seeds.rb +2 -0
  6. data/lib/cadenero/version.rb +2 -2
  7. data/lib/generators/cadenero/install/templates/initializer.rb +16 -0
  8. data/lib/generators/cadenero/install_generator.rb +143 -0
  9. data/spec/controllers/cadenero/v1/accounts_controller_spec.rb +25 -0
  10. data/spec/dummy/README.rdoc +261 -0
  11. data/spec/dummy/Rakefile +7 -0
  12. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  13. data/spec/dummy/config/application.rb +63 -0
  14. data/spec/dummy/config/boot.rb +10 -0
  15. data/spec/dummy/config/database.yml +14 -0
  16. data/spec/dummy/config/environment.rb +5 -0
  17. data/spec/dummy/config/environments/development.rb +39 -0
  18. data/spec/dummy/config/environments/production.rb +69 -0
  19. data/spec/dummy/config/environments/test.rb +39 -0
  20. data/spec/dummy/config/initializers/cadenero.rb +0 -0
  21. data/spec/dummy/config/initializers/secret_token.rb +19 -0
  22. data/spec/dummy/config/initializers/wrap_parameters.rb +13 -0
  23. data/spec/dummy/config/locales/en.yml +5 -0
  24. data/spec/dummy/config/routes.rb +3 -0
  25. data/spec/dummy/config.ru +4 -0
  26. data/spec/dummy/db/schema.rb +45 -0
  27. data/spec/dummy/log/development.log +94 -0
  28. data/spec/dummy/log/test.log +8934 -0
  29. data/spec/dummy/public/404.html +26 -0
  30. data/spec/dummy/public/422.html +26 -0
  31. data/spec/dummy/public/500.html +25 -0
  32. data/spec/dummy/public/favicon.ico +0 -0
  33. data/spec/dummy/script/rails +6 -0
  34. data/spec/dummy/spec/spec_helper.rb +38 -0
  35. data/spec/dummy/tmp/ember-rails/ember-data.js +8886 -0
  36. data/spec/dummy/tmp/ember-rails/ember.js +29953 -0
  37. data/spec/features/accounts/sign_up_spec.rb +32 -0
  38. data/spec/features/cadenero/account_spec.rb +24 -0
  39. data/spec/features/users/sign_in_spec.rb +63 -0
  40. data/spec/features/users/sign_up_spec.rb +26 -0
  41. data/spec/generators/install_generator_spec.rb +56 -0
  42. data/spec/models/cadenero/account_spec.rb +7 -0
  43. data/spec/models/cadenero/member_spec.rb +7 -0
  44. data/spec/models/cadenero/user_spec.rb +7 -0
  45. data/spec/spec_helper.rb +77 -0
  46. data/spec/support/factories/account_factory.rb +15 -0
  47. data/spec/support/factories/user_factory.rb +6 -0
  48. data/spec/support/generator_macros.rb +29 -0
  49. data/spec/support/subdomain_helpers.rb +8 -0
  50. metadata +93 -9
  51. data/db/migrate/20130612093908_add_authentication_token_to_accounts.rb +0 -6
@@ -0,0 +1,69 @@
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
+ config.ember.variant = :production
8
+
9
+ # Full error reports are disabled and caching is turned on
10
+ config.consider_all_requests_local = false
11
+ config.action_controller.perform_caching = true
12
+
13
+ # Disable Rails's static asset server (Apache or nginx will already do this)
14
+ config.serve_static_assets = false
15
+
16
+ # Compress JavaScripts and CSS
17
+ config.assets.compress = true
18
+
19
+ # Don't fallback to assets pipeline if a precompiled asset is missed
20
+ config.assets.compile = false
21
+
22
+ # Generate digests for assets URLs
23
+ config.assets.digest = true
24
+
25
+ # Defaults to nil and saved in location specified by config.assets.prefix
26
+ # config.assets.manifest = YOUR_PATH
27
+
28
+ # Specifies the header that your server uses for sending files
29
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
30
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
31
+
32
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
33
+ # config.force_ssl = true
34
+
35
+ # See everything in the log (default is :info)
36
+ # config.log_level = :debug
37
+
38
+ # Prepend all log lines with the following tags
39
+ # config.log_tags = [ :subdomain, :uuid ]
40
+
41
+ # Use a different logger for distributed setups
42
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
43
+
44
+ # Use a different cache store in production
45
+ # config.cache_store = :mem_cache_store
46
+
47
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
48
+ # config.action_controller.asset_host = "http://assets.example.com"
49
+
50
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
51
+ # config.assets.precompile += %w( search.js )
52
+
53
+ # Disable delivery errors, bad email addresses will be ignored
54
+ # config.action_mailer.raise_delivery_errors = false
55
+
56
+ # Enable threaded mode
57
+ # config.threadsafe!
58
+
59
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
60
+ # the I18n.default_locale when a translation can not be found)
61
+ config.i18n.fallbacks = true
62
+
63
+ # Send deprecation notices to registered listeners
64
+ config.active_support.deprecation = :notify
65
+
66
+ # Log the query plan for queries taking more than this (works
67
+ # with SQLite, MySQL, and PostgreSQL)
68
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
69
+ end
@@ -0,0 +1,39 @@
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
+ config.ember.variant = :development
11
+
12
+ # Configure static asset server for tests with Cache-Control for performance
13
+ config.serve_static_assets = true
14
+ config.static_cache_control = "public, max-age=3600"
15
+
16
+ # Log error messages when you accidentally call methods on nil
17
+ config.whiny_nils = true
18
+
19
+ # Show full error reports and disable caching
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ # config.action_mailer.delivery_method = :test
33
+
34
+ # Raise exception on mass assignment protection for Active Record models
35
+ config.active_record.mass_assignment_sanitizer = :strict
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
File without changes
@@ -0,0 +1,19 @@
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
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ # Although this is not needed for an api-only application, rails4
14
+ # requires secret_key_base or secret_toke to be defined, otherwise an
15
+ # error is raised.
16
+ # Using secret_token for rails3 compatibility. Change to secret_key_base
17
+ # to avoid deprecation warning.
18
+ # Can be safely removed in a rails3 api-only application.
19
+ Dummy::Application.config.secret_token = 'df98291699a229624c0907ad6236b289bc51369d1d1f2729b2c66cdad46b60cb2cb64b93d47b0d2fd9aa4f833bc8d4c98eaaed223f9d4b9ed684677f655611e8'
@@ -0,0 +1,13 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper
4
+
5
+ # Enable parameter wrapping for JSON.
6
+ # ActiveSupport.on_load(:action_controller) do
7
+ # wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
8
+ # end
9
+
10
+ # To enable root element in JSON for ActiveRecord objects.
11
+ # ActiveSupport.on_load(:active_record) do
12
+ # self.include_root_in_json = true
13
+ # 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,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Cadenero::Engine => "/"
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,45 @@
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 => 20130612073709) do
15
+
16
+ create_table "cadenero_accounts", :force => true do |t|
17
+ t.string "name"
18
+ t.string "subdomain"
19
+ t.string "authentication_token"
20
+ t.integer "owner_id"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ add_index "cadenero_accounts", ["authentication_token"], :name => "index_cadenero_accounts_on_authentication_token"
26
+ add_index "cadenero_accounts", ["owner_id"], :name => "index_cadenero_accounts_on_owner_id"
27
+
28
+ create_table "cadenero_members", :force => true do |t|
29
+ t.integer "account_id"
30
+ t.integer "user_id"
31
+ t.datetime "created_at", :null => false
32
+ t.datetime "updated_at", :null => false
33
+ end
34
+
35
+ add_index "cadenero_members", ["account_id"], :name => "index_cadenero_members_on_account_id"
36
+ add_index "cadenero_members", ["user_id"], :name => "index_cadenero_members_on_user_id"
37
+
38
+ create_table "cadenero_users", :force => true do |t|
39
+ t.string "email"
40
+ t.string "password_digest"
41
+ t.datetime "created_at", :null => false
42
+ t.datetime "updated_at", :null => false
43
+ end
44
+
45
+ end
@@ -0,0 +1,94 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+ Connecting to database specified by database.yml
4
+ Connecting to database specified by database.yml
5
+ Connecting to database specified by database.yml
6
+ Connecting to database specified by database.yml
7
+ Connecting to database specified by database.yml
8
+ Connecting to database specified by database.yml
9
+ Connecting to database specified by database.yml
10
+ Connecting to database specified by database.yml
11
+ Connecting to database specified by database.yml
12
+ Connecting to database specified by database.yml
13
+ Connecting to database specified by database.yml
14
+ Connecting to database specified by database.yml
15
+ Connecting to database specified by database.yml
16
+ Connecting to database specified by database.yml
17
+ Connecting to database specified by database.yml
18
+  (32.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
19
+  (5.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
20
+  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
21
+ Migrating to CreateCadeneroV1Accounts (20130612061604)
22
+  (0.1ms) BEGIN
23
+  (22.8ms) CREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
24
+  (3.7ms) CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
25
+  (9.8ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612061604')
26
+  (2.0ms) COMMIT
27
+ Migrating to CreateCadeneroV1Users (20130612064652)
28
+  (0.3ms) BEGIN
29
+  (4.5ms) CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
30
+  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612064652')
31
+  (1.6ms) COMMIT
32
+ Migrating to CreateCadeneroV1Members (20130612073709)
33
+  (0.3ms) BEGIN
34
+  (0.2ms) ROLLBACK
35
+ Connecting to database specified by database.yml
36
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
37
+ Migrating to CreateCadeneroV1Accounts (20130612061604)
38
+ Migrating to CreateCadeneroV1Users (20130612064652)
39
+ Migrating to CreateCadeneroV1Members (20130612073709)
40
+  (0.1ms) BEGIN
41
+  (0.1ms) ROLLBACK
42
+ Connecting to database specified by database.yml
43
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
44
+ Migrating to CreateCadeneroV1Accounts (20130612061604)
45
+ Migrating to CreateCadeneroV1Users (20130612064652)
46
+ Migrating to CreateCadeneroV1Members (20130612073709)
47
+  (0.1ms) BEGIN
48
+  (0.1ms) ROLLBACK
49
+ Connecting to database specified by database.yml
50
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
51
+ Migrating to CreateCadeneroV1Accounts (20130612061604)
52
+ Migrating to CreateCadeneroV1Users (20130612064652)
53
+ Migrating to CreateCadeneroV1Members (20130612073709)
54
+  (0.1ms) BEGIN
55
+  (6.0ms) CREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
56
+  (0.9ms) CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
57
+  (1.1ms) CREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")
58
+  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612073709')
59
+  (2.0ms) COMMIT
60
+ Migrating to AddAuthenticationTokenToAccounts (20130612093908)
61
+  (0.2ms) BEGIN
62
+  (1.2ms) ALTER TABLE "cadenero_accounts" ADD COLUMN "authentication_token" character varying(255)
63
+  (1.2ms) CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
64
+  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612093908')
65
+  (10.3ms) COMMIT
66
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
67
+ Connecting to database specified by database.yml
68
+ Connecting to database specified by database.yml
69
+ Connecting to database specified by database.yml
70
+ Connecting to database specified by database.yml
71
+ Connecting to database specified by database.yml
72
+  (5.3ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
73
+  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
74
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
75
+ Migrating to CreateCadeneroV1Accounts (20130612061604)
76
+  (0.1ms) BEGIN
77
+  (6.5ms) CREATE TABLE "cadenero_accounts" ("id" serial primary key, "name" character varying(255), "subdomain" character varying(255), "authentication_token" character varying(255), "owner_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
78
+  (1.1ms) CREATE INDEX "index_cadenero_accounts_on_owner_id" ON "cadenero_accounts" ("owner_id")
79
+  (1.1ms) CREATE INDEX "index_cadenero_accounts_on_authentication_token" ON "cadenero_accounts" ("authentication_token")
80
+  (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612061604')
81
+  (1.0ms) COMMIT
82
+ Migrating to CreateCadeneroV1Users (20130612064652)
83
+  (0.6ms) BEGIN
84
+  (4.4ms) CREATE TABLE "cadenero_users" ("id" serial primary key, "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
85
+  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612064652')
86
+  (1.0ms) COMMIT
87
+ Migrating to CreateCadeneroV1Members (20130612073709)
88
+  (0.2ms) BEGIN
89
+  (18.0ms) CREATE TABLE "cadenero_members" ("id" serial primary key, "account_id" integer, "user_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
90
+  (1.3ms) CREATE INDEX "index_cadenero_members_on_account_id" ON "cadenero_members" ("account_id")
91
+  (2.5ms) CREATE INDEX "index_cadenero_members_on_user_id" ON "cadenero_members" ("user_id")
92
+  (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ('20130612073709')
93
+  (1.1ms) COMMIT
94
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"