Browse code

Init commit

Cinan Rakosnik authored on 04/02/2013 at 18:55:42
Showing 59 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,8 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<Settings><!--This file was automatically generated by Ruby plugin.
2
+You are allowed to: 
3
+1. Reorder generators
4
+2. Remove generators
5
+3. Add installed generators
6
+To add new installed generators automatically delete this file and reload the project.
7
+--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="assets" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jquery:install" /><Generator name="js:assets" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="mongoid:config" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="task" /></GeneratorsGroup></Settings>
0 8
new file mode 100755
... ...
@@ -0,0 +1,15 @@
0
+# See http://help.github.com/ignore-files/ for more about ignoring files.
1
+#
2
+# If you find yourself ignoring temporary files generated by your text editor
3
+# or operating system, you probably want to add a global ignore instead:
4
+#   git config --global core.excludesfile ~/.gitignore_global
5
+
6
+# Ignore bundler config
7
+/.bundle
8
+
9
+# Ignore the default SQLite database.
10
+/db/*.sqlite3
11
+
12
+# Ignore all logfiles and tempfiles.
13
+/log/*.log
14
+/tmp
0 15
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
1
+<Settings><!--This file was automatically generated by Ruby plugin.
2
+You are allowed to: 
3
+1. Remove rake task
4
+2. Add existing rake tasks
5
+To add existing rake tasks automatically delete this file and reload the project.
6
+--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="List versions of all Rails frameworks and the environment" fullCmd="about" taksId="about" /><RakeGroup description="" fullCmd="" taksId="assets"><RakeTask description="Remove compiled assets" fullCmd="assets:clean" taksId="clean" /><RakeTask description="Compile all the assets named in config.assets.precompile" fullCmd="assets:precompile" taksId="precompile" /><RakeGroup description="" fullCmd="" taksId="clean"><RakeTask description="" fullCmd="assets:clean:all" taksId="all" /></RakeGroup><RakeTask description="" fullCmd="assets:environment" taksId="environment" /><RakeGroup description="" fullCmd="" taksId="precompile"><RakeTask description="" fullCmd="assets:precompile:all" taksId="all" /><RakeTask description="" fullCmd="assets:precompile:nondigest" taksId="nondigest" /><RakeTask description="" fullCmd="assets:precompile:primary" taksId="primary" /></RakeGroup></RakeGroup><RakeGroup description="" fullCmd="" taksId="db"><RakeTask description="Drops all the collections for the database for the current Rails.env" fullCmd="db:drop" taksId="drop" /><RakeGroup description="" fullCmd="" taksId="mongoid"><RakeTask description="Create the indexes defined on your mongoid models" fullCmd="db:mongoid:create_indexes" taksId="create_indexes" /><RakeTask description="Drops the database for the current Rails.env" fullCmd="db:mongoid:drop" taksId="drop" /><RakeTask description="Remove the indexes defined on your mongoid models without questions!" fullCmd="db:mongoid:remove_indexes" taksId="remove_indexes" /></RakeGroup><RakeTask description="Delete data and seed" fullCmd="db:reseed" taksId="reseed" /><RakeTask description="Load the seed data from db/seeds.rb" fullCmd="db:seed" taksId="seed" /><RakeTask description="Create the database, and initialize with the seed data" fullCmd="db:setup" taksId="setup" /><RakeTask description="" fullCmd="db:create" taksId="create" /><RakeTask description="" fullCmd="db:create_indexes" taksId="create_indexes" /><RakeTask description="" fullCmd="db:migrate" taksId="migrate" /><RakeTask description="" fullCmd="db:remove_indexes" taksId="remove_indexes" /><RakeGroup description="" fullCmd="" taksId="schema"><RakeTask description="" fullCmd="db:schema:load" taksId="load" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="test"><RakeTask description="" fullCmd="db:test:prepare" taksId="prepare" /></RakeGroup></RakeGroup><RakeGroup description="" fullCmd="" taksId="doc"><RakeTask description="Generate docs for the app -- also available doc:rails, doc:guides, doc:plugins (options: TEMPLATE=/rdoc-template.rb, TITLE=&quot;Custom Title&quot;)" fullCmd="doc:app" taksId="app" /><RakeTask description="" fullCmd="doc:clobber" taksId="clobber" /><RakeTask description="" fullCmd="doc:clobber_app" taksId="clobber_app" /><RakeTask description="" fullCmd="doc:clobber_plugins" taksId="clobber_plugins" /><RakeTask description="" fullCmd="doc:clobber_rails" taksId="clobber_rails" /><RakeTask description="" fullCmd="doc:guides" taksId="guides" /><RakeTask description="" fullCmd="doc:plugins" taksId="plugins" /><RakeTask description="" fullCmd="doc:rails" taksId="rails" /><RakeTask description="" fullCmd="doc:reapp" taksId="reapp" /><RakeTask description="" fullCmd="doc:rerails" taksId="rerails" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="log"><RakeTask description="Truncates all *.log files in log/ to zero bytes" fullCmd="log:clear" taksId="clear" /></RakeGroup><RakeTask description="Prints out your Rack middleware stack" fullCmd="middleware" taksId="middleware" /><RakeTask description="Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)" fullCmd="notes" taksId="notes" /><RakeGroup description="" fullCmd="" taksId="notes"><RakeTask description="Enumerate a custom annotation, specify with ANNOTATION=CUSTOM" fullCmd="notes:custom" taksId="custom" /><RakeTask description="" fullCmd="notes:fixme" taksId="fixme" /><RakeTask description="" fullCmd="notes:optimize" taksId="optimize" /><RakeTask description="" fullCmd="notes:todo" taksId="todo" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="rails"><RakeTask description="Applies the template supplied by LOCATION=(/path/to/template) or URL" fullCmd="rails:template" taksId="template" /><RakeTask description="Update configs and some other initially generated files (or use just update:configs, update:scripts, or update:application_controller)" fullCmd="rails:update" taksId="update" /><RakeGroup description="" fullCmd="" taksId="templates"><RakeTask description="" fullCmd="rails:templates:copy" taksId="copy" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="update"><RakeTask description="" fullCmd="rails:update:application_controller" taksId="application_controller" /><RakeTask description="" fullCmd="rails:update:configs" taksId="configs" /><RakeTask description="" fullCmd="rails:update:scripts" taksId="scripts" /></RakeGroup></RakeGroup><RakeTask description="Print out all defined routes in match order, with names" fullCmd="routes" taksId="routes" /><RakeTask description="Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions)" fullCmd="secret" taksId="secret" /><RakeTask description="Report code statistics (KLOCs, etc) from the application" fullCmd="stats" taksId="stats" /><RakeTask description="Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)" fullCmd="test" taksId="test" /><RakeGroup description="" fullCmd="" taksId="test"><RakeTask description="Run tests for {:recent=&gt;&quot;test:prepare&quot;} / Test recent changes" fullCmd="test:recent" taksId="recent" /><RakeTask description="Run tests for {:single=&gt;&quot;test:prepare&quot;}" fullCmd="test:single" taksId="single" /><RakeTask description="Run tests for {:uncommitted=&gt;&quot;test:prepare&quot;} / Test changes since last checkin (only Subversion and Git)" fullCmd="test:uncommitted" taksId="uncommitted" /><RakeTask description="" fullCmd="test:benchmark" taksId="benchmark" /><RakeTask description="" fullCmd="test:functionals" taksId="functionals" /><RakeTask description="" fullCmd="test:integration" taksId="integration" /><RakeTask description="" fullCmd="test:plugins" taksId="plugins" /><RakeTask description="" fullCmd="test:prepare" taksId="prepare" /><RakeTask description="" fullCmd="test:profile" taksId="profile" /><RakeTask description="" fullCmd="test:run" taksId="run" /><RakeTask description="" fullCmd="test:units" taksId="units" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="time"><RakeGroup description="" fullCmd="" taksId="zones"><RakeTask description="Displays all time zones, also available: time:zones:us, time:zones:local -- filter with OFFSET parameter, e.g., OFFSET=-6" fullCmd="time:zones:all" taksId="all" /><RakeTask description="" fullCmd="time:zones:local" taksId="local" /><RakeTask description="" fullCmd="time:zones:us" taksId="us" /></RakeGroup></RakeGroup><RakeGroup description="" fullCmd="" taksId="tmp"><RakeTask description="Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)" fullCmd="tmp:clear" taksId="clear" /><RakeTask description="Creates tmp directories for sessions, cache, sockets, and pids" fullCmd="tmp:create" taksId="create" /><RakeGroup description="" fullCmd="" taksId="cache"><RakeTask description="" fullCmd="tmp:cache:clear" taksId="clear" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="pids"><RakeTask description="" fullCmd="tmp:pids:clear" taksId="clear" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="sessions"><RakeTask description="" fullCmd="tmp:sessions:clear" taksId="clear" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="sockets"><RakeTask description="" fullCmd="tmp:sockets:clear" taksId="clear" /></RakeGroup></RakeGroup><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="doc" taksId="doc" /><RakeTask description="" fullCmd="doc/api" taksId="doc/api" /><RakeTask description="" fullCmd="doc/api/index.html" taksId="doc/api/index.html" /><RakeTask description="" fullCmd="doc/app" taksId="doc/app" /><RakeTask description="" fullCmd="doc/app/index.html" taksId="doc/app/index.html" /><RakeTask description="" fullCmd="environment" taksId="environment" /><RakeTask description="" fullCmd="rails_env" taksId="rails_env" /></RakeGroup></Settings>
0 7
new file mode 100755
... ...
@@ -0,0 +1,47 @@
0
+source 'https://rubygems.org'
1
+
2
+gem 'rails', '3.2.11'
3
+
4
+# Bundle edge Rails instead:
5
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
6
+
7
+gem "mongoid", "~> 3.0.20"
8
+
9
+# Gems used only for assets and not required
10
+# in production environments by default.
11
+group :assets do
12
+  gem 'sass-rails',   '~> 3.2.3'
13
+  gem 'coffee-rails', '~> 3.2.1'
14
+
15
+  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
16
+  # gem 'therubyracer', :platforms => :ruby
17
+
18
+  gem 'uglifier', '>= 1.0.3'
19
+  gem "compass", "~> 0.12.2"
20
+
21
+end
22
+
23
+group :development, :test do
24
+  gem 'rspec-rails'
25
+  gem 'spork'
26
+end
27
+
28
+group :development do
29
+end
30
+
31
+gem 'jquery-rails'
32
+gem "haml", "~> 3.1.7"
33
+gem "haml-rails", "~> 0.3.5"
34
+gem "xmpp4r", "~> 0.5"
35
+
36
+# To use ActiveModel has_secure_password
37
+# gem 'bcrypt-ruby', '~> 3.0.0'
38
+
39
+# To use Jbuilder templates for JSON
40
+# gem 'jbuilder'
41
+
42
+# Deploy with Capistrano
43
+gem 'capistrano'
44
+
45
+# To use debugger
46
+# gem 'debugger'
0 47
new file mode 100755
... ...
@@ -0,0 +1,165 @@
0
+GEM
1
+  remote: https://rubygems.org/
2
+  specs:
3
+    actionmailer (3.2.11)
4
+      actionpack (= 3.2.11)
5
+      mail (~> 2.4.4)
6
+    actionpack (3.2.11)
7
+      activemodel (= 3.2.11)
8
+      activesupport (= 3.2.11)
9
+      builder (~> 3.0.0)
10
+      erubis (~> 2.7.0)
11
+      journey (~> 1.0.4)
12
+      rack (~> 1.4.0)
13
+      rack-cache (~> 1.2)
14
+      rack-test (~> 0.6.1)
15
+      sprockets (~> 2.2.1)
16
+    activemodel (3.2.11)
17
+      activesupport (= 3.2.11)
18
+      builder (~> 3.0.0)
19
+    activerecord (3.2.11)
20
+      activemodel (= 3.2.11)
21
+      activesupport (= 3.2.11)
22
+      arel (~> 3.0.2)
23
+      tzinfo (~> 0.3.29)
24
+    activeresource (3.2.11)
25
+      activemodel (= 3.2.11)
26
+      activesupport (= 3.2.11)
27
+    activesupport (3.2.11)
28
+      i18n (~> 0.6)
29
+      multi_json (~> 1.0)
30
+    arel (3.0.2)
31
+    builder (3.0.4)
32
+    capistrano (2.14.1)
33
+      highline
34
+      net-scp (>= 1.0.0)
35
+      net-sftp (>= 2.0.0)
36
+      net-ssh (>= 2.0.14)
37
+      net-ssh-gateway (>= 1.1.0)
38
+    chunky_png (1.2.7)
39
+    coffee-rails (3.2.2)
40
+      coffee-script (>= 2.2.0)
41
+      railties (~> 3.2.0)
42
+    coffee-script (2.2.0)
43
+      coffee-script-source
44
+      execjs
45
+    coffee-script-source (1.4.0)
46
+    compass (0.12.2)
47
+      chunky_png (~> 1.2)
48
+      fssm (>= 0.2.7)
49
+      sass (~> 3.1)
50
+    diff-lcs (1.1.3)
51
+    erubis (2.7.0)
52
+    execjs (1.4.0)
53
+      multi_json (~> 1.0)
54
+    fssm (0.2.10)
55
+    haml (3.1.7)
56
+    haml-rails (0.3.5)
57
+      actionpack (>= 3.1, < 4.1)
58
+      activesupport (>= 3.1, < 4.1)
59
+      haml (~> 3.1)
60
+      railties (>= 3.1, < 4.1)
61
+    highline (1.6.15)
62
+    hike (1.2.1)
63
+    i18n (0.6.1)
64
+    journey (1.0.4)
65
+    jquery-rails (2.2.0)
66
+      railties (>= 3.0, < 5.0)
67
+      thor (>= 0.14, < 2.0)
68
+    json (1.7.6)
69
+    mail (2.4.4)
70
+      i18n (>= 0.4.0)
71
+      mime-types (~> 1.16)
72
+      treetop (~> 1.4.8)
73
+    mime-types (1.20.1)
74
+    mongoid (3.0.21)
75
+      activemodel (~> 3.1)
76
+      moped (~> 1.2)
77
+      origin (~> 1.0)
78
+      tzinfo (~> 0.3.22)
79
+    moped (1.3.2)
80
+    multi_json (1.5.0)
81
+    net-scp (1.0.4)
82
+      net-ssh (>= 1.99.1)
83
+    net-sftp (2.0.5)
84
+      net-ssh (>= 2.0.9)
85
+    net-ssh (2.6.3)
86
+    net-ssh-gateway (1.1.0)
87
+      net-ssh (>= 1.99.1)
88
+    origin (1.0.11)
89
+    polyglot (0.3.3)
90
+    rack (1.4.4)
91
+    rack-cache (1.2)
92
+      rack (>= 0.4)
93
+    rack-ssl (1.3.3)
94
+      rack
95
+    rack-test (0.6.2)
96
+      rack (>= 1.0)
97
+    rails (3.2.11)
98
+      actionmailer (= 3.2.11)
99
+      actionpack (= 3.2.11)
100
+      activerecord (= 3.2.11)
101
+      activeresource (= 3.2.11)
102
+      activesupport (= 3.2.11)
103
+      bundler (~> 1.0)
104
+      railties (= 3.2.11)
105
+    railties (3.2.11)
106
+      actionpack (= 3.2.11)
107
+      activesupport (= 3.2.11)
108
+      rack-ssl (~> 1.3.2)
109
+      rake (>= 0.8.7)
110
+      rdoc (~> 3.4)
111
+      thor (>= 0.14.6, < 2.0)
112
+    rake (10.0.3)
113
+    rdoc (3.12)
114
+      json (~> 1.4)
115
+    rspec-core (2.12.2)
116
+    rspec-expectations (2.12.1)
117
+      diff-lcs (~> 1.1.3)
118
+    rspec-mocks (2.12.2)
119
+    rspec-rails (2.12.2)
120
+      actionpack (>= 3.0)
121
+      activesupport (>= 3.0)
122
+      railties (>= 3.0)
123
+      rspec-core (~> 2.12.0)
124
+      rspec-expectations (~> 2.12.0)
125
+      rspec-mocks (~> 2.12.0)
126
+    sass (3.2.5)
127
+    sass-rails (3.2.6)
128
+      railties (~> 3.2.0)
129
+      sass (>= 3.1.10)
130
+      tilt (~> 1.3)
131
+    spork (0.9.2)
132
+    sprockets (2.2.2)
133
+      hike (~> 1.2)
134
+      multi_json (~> 1.0)
135
+      rack (~> 1.0)
136
+      tilt (~> 1.1, != 1.3.0)
137
+    thor (0.17.0)
138
+    tilt (1.3.3)
139
+    treetop (1.4.12)
140
+      polyglot
141
+      polyglot (>= 0.3.1)
142
+    tzinfo (0.3.35)
143
+    uglifier (1.3.0)
144
+      execjs (>= 0.3.0)
145
+      multi_json (~> 1.0, >= 1.0.2)
146
+    xmpp4r (0.5)
147
+
148
+PLATFORMS
149
+  ruby
150
+
151
+DEPENDENCIES
152
+  capistrano
153
+  coffee-rails (~> 3.2.1)
154
+  compass (~> 0.12.2)
155
+  haml (~> 3.1.7)
156
+  haml-rails (~> 0.3.5)
157
+  jquery-rails
158
+  mongoid (~> 3.0.20)
159
+  rails (= 3.2.11)
160
+  rspec-rails
161
+  sass-rails (~> 3.2.3)
162
+  spork
163
+  uglifier (>= 1.0.3)
164
+  xmpp4r (~> 0.5)
0 165
new file mode 100755
... ...
@@ -0,0 +1,261 @@
0
+== Welcome to Rails
1
+
2
+Rails is a web-application framework that includes everything needed to create
3
+database-backed web applications according to the Model-View-Control pattern.
4
+
5
+This pattern splits the view (also called the presentation) into "dumb"
6
+templates that are primarily responsible for inserting pre-built data in between
7
+HTML tags. The model contains the "smart" domain objects (such as Account,
8
+Product, Person, Post) that holds all the business logic and knows how to
9
+persist themselves to a database. The controller handles the incoming requests
10
+(such as Save New Account, Update Product, Show Post) by manipulating the model
11
+and directing data to the view.
12
+
13
+In Rails, the model is handled by what's called an object-relational mapping
14
+layer entitled Active Record. This layer allows you to present the data from
15
+database rows as objects and embellish these data objects with business logic
16
+methods. You can read more about Active Record in
17
+link:files/vendor/rails/activerecord/README.html.
18
+
19
+The controller and view are handled by the Action Pack, which handles both
20
+layers by its two parts: Action View and Action Controller. These two layers
21
+are bundled in a single package due to their heavy interdependence. This is
22
+unlike the relationship between the Active Record and Action Pack that is much
23
+more separate. Each of these packages can be used independently outside of
24
+Rails. You can read more about Action Pack in
25
+link:files/vendor/rails/actionpack/README.html.
26
+
27
+
28
+== Getting Started
29
+
30
+1. At the command prompt, create a new Rails application:
31
+       <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
32
+
33
+2. Change directory to <tt>myapp</tt> and start the web server:
34
+       <tt>cd myapp; rails server</tt> (run with --help for options)
35
+
36
+3. Go to http://localhost:3000/ and you'll see:
37
+       "Welcome aboard: You're riding Ruby on Rails!"
38
+
39
+4. Follow the guidelines to start developing your application. You can find
40
+the following resources handy:
41
+
42
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
43
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
44
+
45
+
46
+== Debugging Rails
47
+
48
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
49
+will help you debug it and get it back on the rails.
50
+
51
+First area to check is the application log files. Have "tail -f" commands
52
+running on the server.log and development.log. Rails will automatically display
53
+debugging and runtime information to these files. Debugging info will also be
54
+shown in the browser on requests from 127.0.0.1.
55
+
56
+You can also log your own messages directly into the log file from your code
57
+using the Ruby logger class from inside your controllers. Example:
58
+
59
+  class WeblogController < ActionController::Base
60
+    def destroy
61
+      @weblog = Weblog.find(params[:id])
62
+      @weblog.destroy
63
+      logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
64
+    end
65
+  end
66
+
67
+The result will be a message in your log file along the lines of:
68
+
69
+  Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
70
+
71
+More information on how to use the logger is at http://www.ruby-doc.org/core/
72
+
73
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
74
+several books available online as well:
75
+
76
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
77
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
78
+
79
+These two books will bring you up to speed on the Ruby language and also on
80
+programming in general.
81
+
82
+
83
+== Debugger
84
+
85
+Debugger support is available through the debugger command when you start your
86
+Mongrel or WEBrick server with --debugger. This means that you can break out of
87
+execution at any point in the code, investigate and change the model, and then,
88
+resume execution! You need to install ruby-debug to run the server in debugging
89
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
90
+
91
+  class WeblogController < ActionController::Base
92
+    def index
93
+      @posts = Post.all
94
+      debugger
95
+    end
96
+  end
97
+
98
+So the controller will accept the action, run the first line, then present you
99
+with a IRB prompt in the server window. Here you can do things like:
100
+
101
+  >> @posts.inspect
102
+  => "[#<Post:0x14a6be8
103
+          @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
104
+       #<Post:0x14a6620
105
+          @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
106
+  >> @posts.first.title = "hello from a debugger"
107
+  => "hello from a debugger"
108
+
109
+...and even better, you can examine how your runtime objects actually work:
110
+
111
+  >> f = @posts.first
112
+  => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
113
+  >> f.
114
+  Display all 152 possibilities? (y or n)
115
+
116
+Finally, when you're ready to resume execution, you can enter "cont".
117
+
118
+
119
+== Console
120
+
121
+The console is a Ruby shell, which allows you to interact with your
122
+application's domain model. Here you'll have all parts of the application
123
+configured, just like it is when the application is running. You can inspect
124
+domain models, change values, and save to the database. Starting the script
125
+without arguments will launch it in the development environment.
126
+
127
+To start the console, run <tt>rails console</tt> from the application
128
+directory.
129
+
130
+Options:
131
+
132
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
133
+  made to the database.
134
+* Passing an environment name as an argument will load the corresponding
135
+  environment. Example: <tt>rails console production</tt>.
136
+
137
+To reload your controllers and models after launching the console run
138
+<tt>reload!</tt>
139
+
140
+More information about irb can be found at:
141
+link:http://www.rubycentral.org/pickaxe/irb.html
142
+
143
+
144
+== dbconsole
145
+
146
+You can go to the command line of your database directly through <tt>rails
147
+dbconsole</tt>. You would be connected to the database with the credentials
148
+defined in database.yml. Starting the script without arguments will connect you
149
+to the development database. Passing an argument will connect you to a different
150
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
151
+PostgreSQL and SQLite 3.
152
+
153
+== Description of Contents
154
+
155
+The default directory structure of a generated Ruby on Rails application:
156
+
157
+  |-- app
158
+  |   |-- assets
159
+  |       |-- images
160
+  |       |-- javascripts
161
+  |       `-- stylesheets
162
+  |   |-- controllers
163
+  |   |-- helpers
164
+  |   |-- mailers
165
+  |   |-- models
166
+  |   `-- views
167
+  |       `-- layouts
168
+  |-- config
169
+  |   |-- environments
170
+  |   |-- initializers
171
+  |   `-- locales
172
+  |-- db
173
+  |-- doc
174
+  |-- lib
175
+  |   `-- tasks
176
+  |-- log
177
+  |-- public
178
+  |-- script
179
+  |-- test
180
+  |   |-- fixtures
181
+  |   |-- functional
182
+  |   |-- integration
183
+  |   |-- performance
184
+  |   `-- unit
185
+  |-- tmp
186
+  |   |-- cache
187
+  |   |-- pids
188
+  |   |-- sessions
189
+  |   `-- sockets
190
+  `-- vendor
191
+      |-- assets
192
+          `-- stylesheets
193
+      `-- plugins
194
+
195
+app
196
+  Holds all the code that's specific to this particular application.
197
+
198
+app/assets
199
+  Contains subdirectories for images, stylesheets, and JavaScript files.
200
+
201
+app/controllers
202
+  Holds controllers that should be named like weblogs_controller.rb for
203
+  automated URL mapping. All controllers should descend from
204
+  ApplicationController which itself descends from ActionController::Base.
205
+
206
+app/models
207
+  Holds models that should be named like post.rb. Models descend from
208
+  ActiveRecord::Base by default.
209
+
210
+app/views
211
+  Holds the template files for the view that should be named like
212
+  weblogs/index.html.erb for the WeblogsController#index action. All views use
213
+  eRuby syntax by default.
214
+
215
+app/views/layouts
216
+  Holds the template files for layouts to be used with views. This models the
217
+  common header/footer method of wrapping views. In your views, define a layout
218
+  using the <tt>layout :default</tt> and create a file named default.html.erb.
219
+  Inside default.html.erb, call <% yield %> to render the view using this
220
+  layout.
221
+
222
+app/helpers
223
+  Holds view helpers that should be named like weblogs_helper.rb. These are
224
+  generated for you automatically when using generators for controllers.
225
+  Helpers can be used to wrap functionality for your views into methods.
226
+
227
+config
228
+  Configuration files for the Rails environment, the routing map, the database,
229
+  and other dependencies.
230
+
231
+db
232
+  Contains the database schema in schema.rb. db/migrate contains all the
233
+  sequence of Migrations for your schema.
234
+
235
+doc
236
+  This directory is where your application documentation will be stored when
237
+  generated using <tt>rake doc:app</tt>
238
+
239
+lib
240
+  Application specific libraries. Basically, any kind of custom code that
241
+  doesn't belong under controllers, models, or helpers. This directory is in
242
+  the load path.
243
+
244
+public
245
+  The directory available for the web server. Also contains the dispatchers and the
246
+  default HTML files. This should be set as the DOCUMENT_ROOT of your web
247
+  server.
248
+
249
+script
250
+  Helper scripts for automation and generation.
251
+
252
+test
253
+  Unit and functional tests along with fixtures. When using the rails generate
254
+  command, template test files will be generated for you and placed in this
255
+  directory.
256
+
257
+vendor
258
+  External libraries that the application depends on. Also includes the plugins
259
+  subdirectory. If the app has frozen rails, those gems also go here, under
260
+  vendor/rails/. This directory is in the load path.
0 261
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+#!/usr/bin/env rake
1
+# Add your own tasks in files placed in lib/tasks ending in .rake,
2
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+require File.expand_path('../config/application', __FILE__)
5
+
6
+Xmpp::Application.load_tasks
0 7
new file mode 100755
1 8
Binary files /dev/null and b/app/assets/images/rails.png differ
2 9
new file mode 100755
... ...
@@ -0,0 +1,15 @@
0
+// This is a manifest file that'll be compiled into application.js, which will include all the files
1
+// listed below.
2
+//
3
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
4
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
5
+//
6
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
7
+// the compiled file.
8
+//
9
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
10
+// GO AFTER THE REQUIRES BELOW.
11
+//
12
+//= require jquery
13
+//= require jquery_ujs
14
+//= require_tree .
0 15
new file mode 100755
... ...
@@ -0,0 +1,3 @@
0
+# Place all the behaviors and hooks related to the matching controller here.
1
+# All this logic will automatically be available in application.js.
2
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
0 3
new file mode 100755
... ...
@@ -0,0 +1,13 @@
0
+/*
1
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
2
+ * listed below.
3
+ *
4
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
5
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
6
+ *
7
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
8
+ * compiled file, but it's generally better to create a new file per style scope.
9
+ *
10
+ *= require_self
11
+ *= require_tree .
12
+ */
0 13
new file mode 100755
... ...
@@ -0,0 +1,3 @@
0
+// Place all the styles related to the login controller here.
1
+// They will automatically be included in application.css.
2
+// You can use Sass (SCSS) here: http://sass-lang.com/
0 3
new file mode 100755
... ...
@@ -0,0 +1,3 @@
0
+class ApplicationController < ActionController::Base
1
+  protect_from_forgery
2
+end
0 3
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+class LoginController < ApplicationController
1
+	def index
2
+		p "1"
3
+	end
4
+end
0 5
new file mode 100755
... ...
@@ -0,0 +1,2 @@
0
+module ApplicationHelper
1
+end
0 2
new file mode 100755
... ...
@@ -0,0 +1,2 @@
0
+module LoginHelper
1
+end
0 2
new file mode 100755
1 3
new file mode 100755
2 4
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+class Users
1
+	include Mongoid::Document
2
+
3
+	field :jid, type: String
4
+end
0 5
\ No newline at end of file
1 6
new file mode 100755
... ...
@@ -0,0 +1,9 @@
0
+!!! 5
1
+%html{:lang => :en}
2
+  %head
3
+    %title= yield(:title) + " | App"
4
+    %meta{:charset => "utf-8"}/
5
+    %link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
6
+    = csrf_meta_tags
7
+  %body
8
+    = yield
0 9
\ No newline at end of file
1 10
new file mode 100755
... ...
@@ -0,0 +1,3 @@
0
+- content_for(:title, 'Login')
1
+
2
+Hello
0 3
\ No newline at end of file
1 4
new file mode 100755
... ...
@@ -0,0 +1,4 @@
0
+# This file is used by Rack-based servers to start the application.
1
+
2
+require ::File.expand_path('../config/environment',  __FILE__)
3
+run Xmpp::Application
0 4
new file mode 100755
... ...
@@ -0,0 +1,68 @@
0
+require File.expand_path('../boot', __FILE__)
1
+
2
+# Pick the frameworks you want:
3
+# require "active_record/railtie"
4
+require "action_controller/railtie"
5
+require "action_mailer/railtie"
6
+require "active_resource/railtie"
7
+require "sprockets/railtie"
8
+require "rails/test_unit/railtie"
9
+
10
+if defined?(Bundler)
11
+  # If you precompile assets before deploying to production, use this line
12
+  Bundler.require(*Rails.groups(:assets => %w(development test)))
13
+  # If you want your assets lazily compiled in production, use this line
14
+  # Bundler.require(:default, :assets, Rails.env)
15
+end
16
+
17
+module Xmpp
18
+  class Application < Rails::Application
19
+    # Settings in config/environments/* take precedence over those specified here.
20
+    # Application configuration should go into files in config/initializers
21
+    # -- all .rb files in that directory are automatically loaded.
22
+
23
+    # Custom directories with classes and modules you want to be autoloadable.
24
+    # config.autoload_paths += %W(#{config.root}/extras)
25
+
26
+    # Only load the plugins named here, in the order given (default is alphabetical).
27
+    # :all can be used as a placeholder for all plugins not explicitly named.
28
+    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
29
+
30
+    # Activate observers that should always be running.
31
+    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
32
+
33
+    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
34
+    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
35
+    # config.time_zone = 'Central Time (US & Canada)'
36
+
37
+    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
38
+    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
39
+    # config.i18n.default_locale = :de
40
+
41
+    # Configure the default encoding used in templates for Ruby 1.9.
42
+    config.encoding = "utf-8"
43
+
44
+    # Configure sensitive parameters which will be filtered from the log file.
45
+    config.filter_parameters += [:password]
46
+
47
+    # Enable escaping HTML in JSON.
48
+    config.active_support.escape_html_entities_in_json = true
49
+
50
+    # Use SQL instead of Active Record's schema dumper when creating the database.
51
+    # This is necessary if your schema can't be completely dumped by the schema dumper,
52
+    # like if you have constraints or database-specific column types
53
+    # config.active_record.schema_format = :sql
54
+
55
+    # Enforce whitelist mode for mass assignment.
56
+    # This will create an empty whitelist of attributes available for mass-assignment for all models
57
+    # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
58
+    # parameters by using an attr_accessible or attr_protected declaration.
59
+    # config.active_record.whitelist_attributes = true
60
+
61
+    # Enable the asset pipeline
62
+    config.assets.enabled = true
63
+
64
+    # Version of your assets, change this if you want to expire all your assets
65
+    config.assets.version = '1.0'
66
+  end
67
+end
0 68
new file mode 100755
... ...
@@ -0,0 +1,6 @@
0
+require 'rubygems'
1
+
2
+# Set up gems listed in the Gemfile.
3
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
4
+
5
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
0 6
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+# Load the rails application
1
+require File.expand_path('../application', __FILE__)
2
+
3
+# Initialize the rails application
4
+Xmpp::Application.initialize!
0 5
new file mode 100755
... ...
@@ -0,0 +1,31 @@
0
+Xmpp::Application.configure do
1
+  # Settings specified here will take precedence over those in config/application.rb
2
+
3
+  # In the development environment your application's code is reloaded on
4
+  # every request. This slows down response time but is perfect for development
5
+  # since you don't have to restart the web server when you make code changes.
6
+  config.cache_classes = false
7
+
8
+  # Log error messages when you accidentally call methods on nil.
9
+  config.whiny_nils = true
10
+
11
+  # Show full error reports and disable caching
12
+  config.consider_all_requests_local       = true
13
+  config.action_controller.perform_caching = false
14
+
15
+  # Don't care if the mailer can't send
16
+  config.action_mailer.raise_delivery_errors = false
17
+
18
+  # Print deprecation notices to the Rails logger
19
+  config.active_support.deprecation = :log
20
+
21
+  # Only use best-standards-support built into browsers
22
+  config.action_dispatch.best_standards_support = :builtin
23
+
24
+
25
+  # Do not compress assets
26
+  config.assets.compress = false
27
+
28
+  # Expands the lines which load the assets
29
+  config.assets.debug = true
30
+end
0 31
new file mode 100755
... ...
@@ -0,0 +1,64 @@
0
+Xmpp::Application.configure do
1
+  # Settings specified here will take precedence over those in config/application.rb
2
+
3
+  # Code is not reloaded between requests
4
+  config.cache_classes = true
5
+
6
+  # Full error reports are disabled and caching is turned on
7
+  config.consider_all_requests_local       = false
8
+  config.action_controller.perform_caching = true
9
+
10
+  # Disable Rails's static asset server (Apache or nginx will already do this)
11
+  config.serve_static_assets = false
12
+
13
+  # Compress JavaScripts and CSS
14
+  config.assets.compress = true
15
+
16
+  # Don't fallback to assets pipeline if a precompiled asset is missed
17
+  config.assets.compile = false
18
+
19
+  # Generate digests for assets URLs
20
+  config.assets.digest = true
21
+
22
+  # Defaults to nil and saved in location specified by config.assets.prefix
23
+  # config.assets.manifest = YOUR_PATH
24
+
25
+  # Specifies the header that your server uses for sending files
26
+  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
27
+  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
28
+
29
+  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
30
+  # config.force_ssl = true
31
+
32
+  # See everything in the log (default is :info)
33
+  # config.log_level = :debug
34
+
35
+  # Prepend all log lines with the following tags
36
+  # config.log_tags = [ :subdomain, :uuid ]
37
+
38
+  # Use a different logger for distributed setups
39
+  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
40
+
41
+  # Use a different cache store in production
42
+  # config.cache_store = :mem_cache_store
43
+
44
+  # Enable serving of images, stylesheets, and JavaScripts from an asset server
45
+  # config.action_controller.asset_host = "http://assets.example.com"
46
+
47
+  # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
48
+  # config.assets.precompile += %w( search.js )
49
+
50
+  # Disable delivery errors, bad email addresses will be ignored
51
+  # config.action_mailer.raise_delivery_errors = false
52
+
53
+  # Enable threaded mode
54
+  # config.threadsafe!
55
+
56
+  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
57
+  # the I18n.default_locale when a translation can not be found)
58
+  config.i18n.fallbacks = true
59
+
60
+  # Send deprecation notices to registered listeners
61
+  config.active_support.deprecation = :notify
62
+
63
+end
0 64
new file mode 100755
... ...
@@ -0,0 +1,35 @@
0
+Xmpp::Application.configure do
1
+  # Settings specified here will take precedence over those in config/application.rb
2
+
3
+  # The test environment is used exclusively to run your application's
4
+  # test suite. You never need to work with it otherwise. Remember that
5
+  # your test database is "scratch space" for the test suite and is wiped
6
+  # and recreated between test runs. Don't rely on the data there!
7
+  config.cache_classes = true
8
+
9
+  # Configure static asset server for tests with Cache-Control for performance
10
+  config.serve_static_assets = true
11
+  config.static_cache_control = "public, max-age=3600"
12
+
13
+  # Log error messages when you accidentally call methods on nil
14
+  config.whiny_nils = true
15
+
16
+  # Show full error reports and disable caching
17
+  config.consider_all_requests_local       = true
18
+  config.action_controller.perform_caching = false
19
+
20
+  # Raise exceptions instead of rendering exception templates
21
+  config.action_dispatch.show_exceptions = false
22
+
23
+  # Disable request forgery protection in test environment
24
+  config.action_controller.allow_forgery_protection    = false
25
+
26
+  # Tell Action Mailer not to deliver emails to the real world.
27
+  # The :test delivery method accumulates sent emails in the
28
+  # ActionMailer::Base.deliveries array.
29
+  config.action_mailer.delivery_method = :test
30
+
31
+
32
+  # Print deprecation notices to the stderr
33
+  config.active_support.deprecation = :stderr
34
+end
0 35
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+# Be sure to restart your server when you modify this file.
1
+
2
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
3
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
4
+
5
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
6
+# Rails.backtrace_cleaner.remove_silencers!
0 7
new file mode 100755
... ...
@@ -0,0 +1,15 @@
0
+# Be sure to restart your server when you modify this file.
1
+
2
+# Add new inflection rules using the following format
3
+# (all these examples are active by default):
4
+# ActiveSupport::Inflector.inflections do |inflect|
5
+#   inflect.plural /^(ox)$/i, '\1en'
6
+#   inflect.singular /^(ox)en/i, '\1'
7
+#   inflect.irregular 'person', 'people'
8
+#   inflect.uncountable %w( fish sheep )
9
+# end
10
+#
11
+# These inflection rules are supported but not enabled by default:
12
+# ActiveSupport::Inflector.inflections do |inflect|
13
+#   inflect.acronym 'RESTful'
14
+# end
0 15
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+# Be sure to restart your server when you modify this file.
1
+
2
+# Add new mime types for use in respond_to blocks:
3
+# Mime::Type.register "text/richtext", :rtf
4
+# Mime::Type.register_alias "text/html", :iphone
0 5
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+# Be sure to restart your server when you modify this file.
1
+
2
+# Your secret key for verifying the integrity of signed cookies.
3
+# If you change this key, all old signed cookies will become invalid!
4
+# Make sure the secret is at least 30 characters and all random,
5
+# no regular words or you'll be exposed to dictionary attacks.
6
+Xmpp::Application.config.secret_token = '48c49768f9ec3134de5f76e352f13bf8fd66252d67f6d285c1c6de8457f0499075975aaaef1c32be9d596120302e8e3f7b6200c207835463ecdbb6c1610705c2'
0 7
new file mode 100755
... ...
@@ -0,0 +1,8 @@
0
+# Be sure to restart your server when you modify this file.
1
+
2
+Xmpp::Application.config.session_store :cookie_store, key: '_xmpp_session'
3
+
4
+# Use the database for sessions instead of the cookie-based default,
5
+# which shouldn't be used to store highly confidential information
6
+# (create the session table with "rails generate session_migration")
7
+# Xmpp::Application.config.session_store :active_record_store
0 8
new file mode 100755
... ...
@@ -0,0 +1,10 @@
0
+# Be sure to restart your server when you modify this file.
1
+#
2
+# This file contains settings for ActionController::ParamsWrapper which
3
+# is enabled by default.
4
+
5
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
6
+ActiveSupport.on_load(:action_controller) do
7
+  wrap_parameters format: [:json]
8
+end
9
+
0 10
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+# Sample localization file for English. Add more files in this directory for other locales.
1
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
2
+
3
+en:
4
+  hello: "Hello world"
0 5
new file mode 100755
... ...
@@ -0,0 +1,80 @@
0
+development:
1
+  # Configure available database sessions. (required)
2
+  sessions:
3
+    # Defines the default session. (required)
4
+    default:
5
+      # Defines the name of the default database that Mongoid can connect to.
6
+      # (required).
7
+      database: xmpp_development
8
+      # Provides the hosts the default session can connect to. Must be an array
9
+      # of host:port pairs. (required)
10
+      hosts:
11
+        - localhost:27017
12
+      options:
13
+        # Change whether the session persists in safe mode by default.
14
+        # (default: false)
15
+        # safe: false
16
+
17
+        # Change the default consistency model to :eventual or :strong.
18
+        # :eventual will send reads to secondaries, :strong sends everything
19
+        # to master. (default: :eventual)
20
+        # consistency: :eventual
21
+
22
+        # How many times Moped should attempt to retry an operation after
23
+        # failure. (default: 30)
24
+        # max_retries: 30
25
+
26
+        # The time in seconds that Moped should wait before retrying an
27
+        # operation on failure. (default: 1)
28
+        # retry_interval: 1
29
+  # Configure Mongoid specific options. (optional)
30
+  options:
31
+    # Configuration for whether or not to allow access to fields that do
32
+    # not have a field definition on the model. (default: true)
33
+    # allow_dynamic_fields: true
34
+
35
+    # Enable the identity map, needed for eager loading. (default: false)
36
+    # identity_map_enabled: false
37
+
38
+    # Includes the root model name in json serialization. (default: false)
39
+    # include_root_in_json: false
40
+
41
+    # Include the _type field in serializaion. (default: false)
42
+    # include_type_for_serialization: false
43
+
44
+    # Preload all models in development, needed when models use
45
+    # inheritance. (default: false)
46
+    # preload_models: false
47
+
48
+    # Protect id and type from mass assignment. (default: true)
49
+    # protect_sensitive_fields: true
50
+
51
+    # Raise an error when performing a #find and the document is not found.
52
+    # (default: true)
53
+    # raise_not_found_error: true
54
+
55
+    # Raise an error when defining a scope with the same name as an
56
+    # existing method. (default: false)
57
+    # scope_overwrite_exception: false
58
+
59
+    # Skip the database version check, used when connecting to a db without
60
+    # admin access. (default: false)
61
+    # skip_version_check: false
62
+
63
+    # User Active Support's time zone in conversions. (default: true)
64
+    # use_activesupport_time_zone: true
65
+
66
+    # Ensure all times are UTC in the app side. (default: false)
67
+    # use_utc: false
68
+test:
69
+  sessions:
70
+    default:
71
+      database: xmpp_test
72
+      hosts:
73
+        - localhost:27017
74
+      options:
75
+        consistency: :strong
76
+        # In the test environment we lower the retries and retry interval to
77
+        # low amounts for fast failures.
78
+        max_retries: 1
79
+        retry_interval: 0
0 80
new file mode 100755
... ...
@@ -0,0 +1,55 @@
0
+Xmpp::Application.routes.draw do
1
+  # Sample of regular route:
2
+  #   match 'products/:id' => 'catalog#view'
3
+  # Keep in mind you can assign values other than :controller and :action
4
+
5
+  # Sample of named route:
6
+  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
7
+  # This route can be invoked with purchase_url(:id => product.id)
8
+
9
+  # Sample resource route (maps HTTP verbs to controller actions automatically):
10
+  #   resources :products
11
+
12
+  # Sample resource route with options:
13
+  #   resources :products do
14
+  #     member do
15
+  #       get 'short'
16
+  #       post 'toggle'
17
+  #     end
18
+  #
19
+  #     collection do
20
+  #       get 'sold'
21
+  #     end
22
+  #   end
23
+
24
+  # Sample resource route with sub-resources:
25
+  #   resources :products do
26
+  #     resources :comments, :sales
27
+  #     resource :seller
28
+  #   end
29
+
30
+  # Sample resource route with more complex sub-resources
31
+  #   resources :products do
32
+  #     resources :comments
33
+  #     resources :sales do
34
+  #       get 'recent', :on => :collection
35
+  #     end
36
+  #   end
37
+
38
+  # Sample resource route within a namespace:
39
+  #   namespace :admin do
40
+  #     # Directs /admin/products/* to Admin::ProductsController
41
+  #     # (app/controllers/admin/products_controller.rb)
42
+  #     resources :products
43
+  #   end
44
+
45
+  # You can have the root of your site routed with "root"
46
+  # just remember to delete public/index.html.
47
+  root :to => 'login#index'
48
+
49
+  # See how all your routes lay out with "rake routes"
50
+
51
+  # This is a legacy wild controller route that's not recommended for RESTful applications.
52
+  # Note: This route will make all actions in every controller accessible via GET requests.
53
+  # match ':controller(/:action(/:id))(.:format)'
54
+end
0 55
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+# This file should contain all the record creation needed to seed the database with its default values.
1
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
2
+#
3
+# Examples:
4
+#
5
+#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
6
+#   Mayor.create(name: 'Emanuel', city: cities.first)
0 7
new file mode 100755
... ...
@@ -0,0 +1,2 @@
0
+Use this README file to introduce your application and point to useful places in the API for learning more.
1
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
0 2
new file mode 100755
1 3
new file mode 100755
2 4
new file mode 100755
3 5
new file mode 100755
... ...
@@ -0,0 +1,26 @@
0
+<!DOCTYPE html>
1
+<html>
2
+<head>
3
+  <title>The page you were looking for doesn't exist (404)</title>
4
+  <style type="text/css">
5
+    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
6
+    div.dialog {
7
+      width: 25em;
8
+      padding: 0 4em;
9
+      margin: 4em auto 0 auto;
10
+      border: 1px solid #ccc;
11
+      border-right-color: #999;
12
+      border-bottom-color: #999;
13
+    }
14
+    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
15
+  </style>
16
+</head>
17
+
18
+<body>
19
+  <!-- This file lives in public/404.html -->
20
+  <div class="dialog">
21
+    <h1>The page you were looking for doesn't exist.</h1>
22
+    <p>You may have mistyped the address or the page may have moved.</p>
23
+  </div>
24
+</body>
25
+</html>
0 26
new file mode 100755
... ...
@@ -0,0 +1,26 @@
0
+<!DOCTYPE html>
1
+<html>
2
+<head>
3
+  <title>The change you wanted was rejected (422)</title>
4
+  <style type="text/css">
5
+    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
6
+    div.dialog {
7
+      width: 25em;
8
+      padding: 0 4em;
9
+      margin: 4em auto 0 auto;
10
+      border: 1px solid #ccc;
11
+      border-right-color: #999;
12
+      border-bottom-color: #999;
13
+    }
14
+    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
15
+  </style>
16
+</head>
17
+
18
+<body>
19
+  <!-- This file lives in public/422.html -->
20
+  <div class="dialog">
21
+    <h1>The change you wanted was rejected.</h1>
22
+    <p>Maybe you tried to change something you didn't have access to.</p>
23
+  </div>
24
+</body>
25
+</html>
0 26
new file mode 100755
... ...
@@ -0,0 +1,25 @@
0
+<!DOCTYPE html>
1
+<html>
2
+<head>
3
+  <title>We're sorry, but something went wrong (500)</title>
4
+  <style type="text/css">
5
+    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
6
+    div.dialog {
7
+      width: 25em;
8
+      padding: 0 4em;
9
+      margin: 4em auto 0 auto;
10
+      border: 1px solid #ccc;
11
+      border-right-color: #999;
12
+      border-bottom-color: #999;
13
+    }
14
+    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
15
+  </style>
16
+</head>
17
+
18
+<body>
19
+  <!-- This file lives in public/500.html -->
20
+  <div class="dialog">
21
+    <h1>We're sorry, but something went wrong.</h1>
22
+  </div>
23
+</body>
24
+</html>
0 25
new file mode 100755
1 26
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
1
+#
2
+# To ban all spiders from the entire site uncomment the next two lines:
3
+# User-Agent: *
4
+# Disallow: /
0 5
new file mode 100755
... ...
@@ -0,0 +1,6 @@
0
+#!/usr/bin/env ruby
1
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
2
+
3
+APP_PATH = File.expand_path('../../config/application',  __FILE__)
4
+require File.expand_path('../../config/boot',  __FILE__)
5
+require 'rails/commands'
0 6
new file mode 100755
... ...
@@ -0,0 +1,5 @@
0
+require 'spec_helper'
1
+
2
+describe LoginController do
3
+
4
+end
0 5
new file mode 100755
... ...
@@ -0,0 +1,15 @@
0
+require 'spec_helper'
1
+
2
+# Specs in this file have access to a helper object that includes
3
+# the LoginHelper. For example:
4
+#
5
+# describe LoginHelper do
6
+#   describe "string concat" do
7
+#     it "concats two strings with spaces" do
8
+#       helper.concat_strings("this","that").should == "this that"
9
+#     end
10
+#   end
11
+# end
12
+describe LoginHelper do
13
+  pending "add some examples to (or delete) #{__FILE__}"
14
+end
0 15
new file mode 100755
1 16
new file mode 100755
2 17
new file mode 100755
3 18
new file mode 100755
... ...
@@ -0,0 +1,12 @@
0
+require 'test_helper'
1
+require 'rails/performance_test_help'
2
+
3
+class BrowsingTest < ActionDispatch::PerformanceTest
4
+  # Refer to the documentation for all available options
5
+  # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
6
+  #                          :output => 'tmp/performance', :formats => [:flat] }
7
+
8
+  def test_homepage
9
+    get '/'
10
+  end
11
+end
0 12
new file mode 100755
... ...
@@ -0,0 +1,7 @@
0
+ENV["RAILS_ENV"] = "test"
1
+require File.expand_path('../../config/environment', __FILE__)
2
+require 'rails/test_help'
3
+
4
+class ActiveSupport::TestCase
5
+  # Add more helper methods to be used by all tests here...
6
+end
0 7
new file mode 100755
1 8
new file mode 100755
2 9
new file mode 100755
3 10
new file mode 100755