Skip to content

Commit b5dc52a

Browse files
committedNov 25, 2013
Cleanup sprockets example app
1 parent 5d06f5b commit b5dc52a

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed
 

Diff for: ‎example/app/application.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
require 'opal'
2-
require 'foo'
3-
4-
puts "wow!"
2+
require 'user'
53

64
module MyApp
75
class Application
86
def initialize
9-
@user = Adam.new
10-
@user.bar
7+
@user = User.new('Bill')
8+
@user.authenticated?
119
end
1210
end
1311
end

Diff for: ‎example/app/foo.rb

-19
This file was deleted.

Diff for: ‎example/app/user.rb

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class User
2+
def initialize(name)
3+
@name = name
4+
end
5+
6+
def authenticated?
7+
if admin? or special_persmission?
8+
true
9+
else
10+
raise "not authenticated"
11+
end
12+
end
13+
14+
def admin?
15+
@name == 'Bob'
16+
end
17+
18+
def special_persmission?
19+
false
20+
end
21+
end

0 commit comments

Comments
 (0)