Skip to content

Commit

Permalink
ember-auth 7.x update + bundle update
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsentwined committed Jul 1, 2013
1 parent d2f4abc commit 2836187
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 64 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -29,11 +29,13 @@ gem 'bcrypt-ruby' # password encryption
gem 'inherited_resources' # for easy RESTful API controller scaffolding
gem 'active_model_serializers' # works out of the box with ember-data

gem 'handlebars-source', '1.0.0.rc3'
gem 'ember-rails' # ember framework
gem 'ember-auth-rails' # client-side authentication
gem 'emblem-rails' # easier to write templates

gem 'ember-source', '>= 1.0.0.rc6'
gem 'handlebars-source', '>= 1.0.0.rc4'

gem 'unicorn' # better server gem for heroku

gem 'newrelic_rpm' # prevent heroku from idling
65 changes: 33 additions & 32 deletions Gemfile.lock
Expand Up @@ -50,78 +50,78 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.6.2)
database_cleaner (0.9.1)
database_cleaner (1.0.1)
devise (2.2.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.2.4)
ember-auth-rails (4.0.1)
ember-auth-rails (4.0.2)
ember-auth-source
rails
ember-auth-source (6.0.3)
ember-source (>= 0.0.2, != 1.0.0.rc1.2, != 1.0.0.rc1.1, != 1.0.0.rc1.0.0, != 1.0.0.pre4.1)
ember-data-source (0.0.5)
ember-auth-source (7.0.0)
ember-source (>= 1.0.0.rc6)
ember-data-source (0.13)
ember-source
ember-rails (0.12.0)
ember-rails (0.13.0)
active_model_serializers
barber (>= 0.4.1)
ember-data-source
ember-source (>= 1.0.0.rc2.2)
ember-source
execjs (>= 1.2)
handlebars-source
railties (>= 3.1)
ember-source (1.0.0.rc3.3)
handlebars-source (>= 1.0.0.rc3, < 1.0.0.rc4)
ember-source (1.0.0.rc6)
handlebars-source (= 1.0.0.rc4)
emblem-rails (0.1.1)
barber-emblem (~> 0.1.1)
ember-rails (>= 0.11.1)
emblem-source (0.2.5)
emblem-source (0.2.9)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
fabrication (2.7.0)
ffi (1.8.1)
fabrication (2.7.2)
ffi (1.9.0)
formatador (0.2.4)
guard (1.8.0)
guard (1.8.1)
formatador (>= 0.2.4)
listen (>= 1.0.0)
lumberjack (>= 1.0.2)
pry (>= 0.9.10)
thor (>= 0.14.6)
guard-rspec (3.0.0)
guard-rspec (3.0.2)
guard (>= 1.8)
rspec (~> 2.13)
guard-spork (1.5.0)
guard-spork (1.5.1)
childprocess (>= 0.2.3)
guard (>= 1.1)
spork (>= 0.8.4)
handlebars-source (1.0.0.rc3)
handlebars-source (1.0.0.rc4)
has_scope (0.5.1)
hike (1.2.2)
hike (1.2.3)
i18n (0.6.1)
inherited_resources (1.4.0)
has_scope (~> 0.5.0)
responders (~> 0.9)
journey (1.0.4)
jquery-rails (2.2.1)
jquery-rails (2.3.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.0)
kgio (2.8.0)
listen (1.1.0)
listen (1.2.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
lumberjack (1.0.3)
mail (2.5.3)
i18n (>= 0.4.0)
lumberjack (1.0.4)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.1)
mime-types (1.23)
multi_json (1.7.3)
newrelic_rpm (3.6.2.96)
multi_json (1.7.7)
newrelic_rpm (3.6.5.130)
orm_adapter (0.4.0)
pg (0.15.1)
polyglot (0.3.3)
Expand Down Expand Up @@ -152,7 +152,7 @@ GEM
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.11.0)
rake (10.0.4)
rake (10.1.0)
rb-fchange (0.0.6)
ffi
rb-fsevent (0.9.3)
Expand All @@ -172,7 +172,7 @@ GEM
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.1)
rspec-rails (2.13.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
Expand All @@ -187,10 +187,10 @@ GEM
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.1.1)
shoulda-matchers (2.1.0)
shoulda-context (1.1.4)
shoulda-matchers (2.2.0)
activesupport (>= 3.0.0)
slop (3.4.4)
slop (3.4.5)
spork (0.9.2)
sprockets (2.2.2)
hike (~> 1.2)
Expand All @@ -199,14 +199,14 @@ GEM
tilt (~> 1.1, != 1.3.0)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.12)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
unicorn (4.6.2)
unicorn (4.6.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
Expand All @@ -224,11 +224,12 @@ DEPENDENCIES
devise
ember-auth-rails
ember-rails
ember-source (>= 1.0.0.rc6)
emblem-rails
fabrication
guard-rspec
guard-spork
handlebars-source (= 1.0.0.rc3)
handlebars-source (>= 1.0.0.rc4)
inherited_resources
jquery-rails (~> 2.2)
newrelic_rpm
Expand Down
11 changes: 10 additions & 1 deletion app/assets/javascripts/auth.coffee
Expand Up @@ -5,7 +5,16 @@ EmberAuthRailsDemo.Auth = Em.Auth.create
tokenKey: 'auth_token'
tokenIdKey: 'user_id'

modules: ['emberData', 'rememberable']
modules: ['emberData', 'authRedirectable', 'actionRedirectable', 'rememberable']

authRedirectable:
route: 'sign-in'

actionRedirectable:
signInRoute: 'users'
signInSmart: true
signInBlacklist: ['sign-in']
signOutRoute: 'posts'

rememberable:
tokenKey: 'remember_token'
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/router.coffee
Expand Up @@ -6,3 +6,4 @@ EmberAuthRailsDemo.Router.map ->
@route 'show', {path: '/:post_id'}
@resource 'users', ->
@route 'show', {path: '/:user_id'}
@route 'sign-in'
1 change: 1 addition & 0 deletions app/assets/javascripts/routes/login.coffee
@@ -0,0 +1 @@
EmberAuthRailsDemo.LoginRoute = Em.Route.extend()
5 changes: 2 additions & 3 deletions app/assets/javascripts/routes/users.coffee
@@ -1,4 +1,3 @@
EmberAuthRailsDemo.UsersRoute = Em.Route.extend
EmberAuthRailsDemo.UsersRoute = Em.Route.extend EmberAuthRailsDemo.Auth.AuthRedirectable,
model: ->
if EmberAuthRailsDemo.Auth.get('signedIn')
EmberAuthRailsDemo.User.find()
EmberAuthRailsDemo.User.find()
5 changes: 2 additions & 3 deletions app/assets/javascripts/routes/users/index.coffee
@@ -1,4 +1,3 @@
EmberAuthRailsDemo.UsersIndexRoute = Em.Route.extend
EmberAuthRailsDemo.UsersIndexRoute = Em.Route.extend EmberAuthRailsDemo.Auth.AuthRedirectable,
model: ->
if EmberAuthRailsDemo.Auth.get('signedIn')
EmberAuthRailsDemo.User.find()
EmberAuthRailsDemo.User.find()
6 changes: 1 addition & 5 deletions app/assets/javascripts/routes/users/show.coffee
@@ -1,7 +1,3 @@
EmberAuthRailsDemo.UsersShowRoute = Em.Route.extend
EmberAuthRailsDemo.UsersShowRoute = Em.Route.extend EmberAuthRailsDemo.Auth.AuthRedirectable,
serialize: (model) ->
user_id: model.get('param')

model: (params) ->
if EmberAuthRailsDemo.Auth.get('signedIn')
EmberAuthRailsDemo.User.find(params.user_id)
5 changes: 2 additions & 3 deletions app/assets/javascripts/templates/application.emblem
Expand Up @@ -2,7 +2,6 @@ EmberAuthRailsDemo.AuthView
.nav
linkTo posts.index
| Posts list
if EmberAuthRailsDemo.Auth.signedIn
linkTo users.index
| Users list
linkTo users.index
| Users list
outlet
6 changes: 3 additions & 3 deletions app/assets/javascripts/templates/auth/sign-in.emblem
@@ -1,10 +1,10 @@
form
label Email
Ember.TextField valueBinding=view.email
= input type='text' value=view.email
label Password
Ember.TextField type='password' valueBinding=view.password
= input type='password' value=view.password

Ember.Checkbox checkedBinding=view.remember
= input type='checkbox' checked=view.remember
label Remember me

button Sign In
1 change: 1 addition & 0 deletions app/assets/javascripts/templates/sign-in.emblem
@@ -0,0 +1 @@
| You need to sign in first.
9 changes: 3 additions & 6 deletions app/assets/javascripts/templates/users/index.emblem
@@ -1,6 +1,3 @@
if EmberAuthRailsDemo.Auth.signedIn
ul: each controller
li: linkTo users.show this
email
else
| You need to sign in first
ul: each controller
li: linkTo users.show this
email
11 changes: 4 additions & 7 deletions app/assets/javascripts/templates/users/show.emblem
@@ -1,7 +1,4 @@
if EmberAuthRailsDemo.Auth.signedIn
h1
email
linkTo users.index
| Back to users list
else
| You need to sign in first
h1
email
linkTo users.index
| Back to users list

0 comments on commit 2836187

Please sign in to comment.