rails_magic_renamer 2.0.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +6 -0
  5. data/CHANGELOG +4 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +173 -0
  8. data/Guardfile +11 -0
  9. data/Manifest +8 -0
  10. data/README.md +59 -0
  11. data/ROADMAP.md +60 -0
  12. data/Rakefile +2 -0
  13. data/lib/rails_magic_renamer.rb +343 -0
  14. data/lib/rails_magic_renamer/exceptions.rb +35 -0
  15. data/lib/rails_magic_renamer/version.rb +3 -0
  16. data/rails_magic_renamer.gemspec +36 -0
  17. data/spec/rails_helper.rb +26 -0
  18. data/spec/rails_magic_renamer_spec.rb +22 -0
  19. data/spec/spec_helper.rb +17 -0
  20. data/spec/support/sample_app_rails_4/.gitignore +19 -0
  21. data/spec/support/sample_app_rails_4/.rspec +2 -0
  22. data/spec/support/sample_app_rails_4/Gemfile +58 -0
  23. data/spec/support/sample_app_rails_4/Gemfile.lock +249 -0
  24. data/spec/support/sample_app_rails_4/Guardfile +53 -0
  25. data/spec/support/sample_app_rails_4/LICENSE +21 -0
  26. data/spec/support/sample_app_rails_4/README.md +25 -0
  27. data/spec/support/sample_app_rails_4/README.nitrous.md +20 -0
  28. data/spec/support/sample_app_rails_4/Rakefile +6 -0
  29. data/spec/support/sample_app_rails_4/app/assets/images/rails.png +0 -0
  30. data/spec/support/sample_app_rails_4/app/assets/javascripts/application.js +17 -0
  31. data/spec/support/sample_app_rails_4/app/assets/javascripts/sessions.js.coffee +3 -0
  32. data/spec/support/sample_app_rails_4/app/assets/javascripts/static_pages.js.coffee +3 -0
  33. data/spec/support/sample_app_rails_4/app/assets/javascripts/users.js.coffee +3 -0
  34. data/spec/support/sample_app_rails_4/app/assets/stylesheets/application.css +13 -0
  35. data/spec/support/sample_app_rails_4/app/assets/stylesheets/custom.css.scss +246 -0
  36. data/spec/support/sample_app_rails_4/app/assets/stylesheets/sessions.css.scss +3 -0
  37. data/spec/support/sample_app_rails_4/app/assets/stylesheets/static_pages.css.scss +3 -0
  38. data/spec/support/sample_app_rails_4/app/assets/stylesheets/users.css.scss +3 -0
  39. data/spec/support/sample_app_rails_4/app/controllers/application_controller.rb +6 -0
  40. data/spec/support/sample_app_rails_4/app/controllers/concerns/.keep +0 -0
  41. data/spec/support/sample_app_rails_4/app/controllers/microposts_controller.rb +31 -0
  42. data/spec/support/sample_app_rails_4/app/controllers/relationships_controller.rb +21 -0
  43. data/spec/support/sample_app_rails_4/app/controllers/sessions_controller.rb +21 -0
  44. data/spec/support/sample_app_rails_4/app/controllers/static_pages_controller.rb +18 -0
  45. data/spec/support/sample_app_rails_4/app/controllers/users_controller.rb +80 -0
  46. data/spec/support/sample_app_rails_4/app/helpers/application_helper.rb +12 -0
  47. data/spec/support/sample_app_rails_4/app/helpers/sessions_helper.rb +49 -0
  48. data/spec/support/sample_app_rails_4/app/helpers/static_pages_helper.rb +2 -0
  49. data/spec/support/sample_app_rails_4/app/helpers/users_helper.rb +10 -0
  50. data/spec/support/sample_app_rails_4/app/mailers/.keep +0 -0
  51. data/spec/support/sample_app_rails_4/app/models/.keep +0 -0
  52. data/spec/support/sample_app_rails_4/app/models/comment.rb +5 -0
  53. data/spec/support/sample_app_rails_4/app/models/concerns/.keep +0 -0
  54. data/spec/support/sample_app_rails_4/app/models/micropost.rb +14 -0
  55. data/spec/support/sample_app_rails_4/app/models/organisation.rb +3 -0
  56. data/spec/support/sample_app_rails_4/app/models/relationship.rb +6 -0
  57. data/spec/support/sample_app_rails_4/app/models/user.rb +57 -0
  58. data/spec/support/sample_app_rails_4/app/models/user_comment.rb +5 -0
  59. data/spec/support/sample_app_rails_4/app/views/layouts/_footer.html.erb +13 -0
  60. data/spec/support/sample_app_rails_4/app/views/layouts/_header.html.erb +31 -0
  61. data/spec/support/sample_app_rails_4/app/views/layouts/_shim.html.erb +3 -0
  62. data/spec/support/sample_app_rails_4/app/views/layouts/application.html.erb +22 -0
  63. data/spec/support/sample_app_rails_4/app/views/microposts/_micropost.html.erb +11 -0
  64. data/spec/support/sample_app_rails_4/app/views/relationships/create.js.erb +2 -0
  65. data/spec/support/sample_app_rails_4/app/views/relationships/destroy.js.erb +2 -0
  66. data/spec/support/sample_app_rails_4/app/views/sessions/new.html.erb +19 -0
  67. data/spec/support/sample_app_rails_4/app/views/shared/_error_messages.html.erb +12 -0
  68. data/spec/support/sample_app_rails_4/app/views/shared/_feed.html.erb +6 -0
  69. data/spec/support/sample_app_rails_4/app/views/shared/_feed_item.html.erb +15 -0
  70. data/spec/support/sample_app_rails_4/app/views/shared/_micropost_form.html.erb +7 -0
  71. data/spec/support/sample_app_rails_4/app/views/shared/_stats.html.erb +15 -0
  72. data/spec/support/sample_app_rails_4/app/views/shared/_user_info.html.erb +12 -0
  73. data/spec/support/sample_app_rails_4/app/views/static_pages/about.html.erb +8 -0
  74. data/spec/support/sample_app_rails_4/app/views/static_pages/contact.html.erb +6 -0
  75. data/spec/support/sample_app_rails_4/app/views/static_pages/help.html.erb +8 -0
  76. data/spec/support/sample_app_rails_4/app/views/static_pages/home.html.erb +34 -0
  77. data/spec/support/sample_app_rails_4/app/views/static_pages/show.html.erb +0 -0
  78. data/spec/support/sample_app_rails_4/app/views/users/_follow.html.erb +5 -0
  79. data/spec/support/sample_app_rails_4/app/views/users/_follow_form.html.erb +9 -0
  80. data/spec/support/sample_app_rails_4/app/views/users/_unfollow.html.erb +5 -0
  81. data/spec/support/sample_app_rails_4/app/views/users/_user.html.erb +8 -0
  82. data/spec/support/sample_app_rails_4/app/views/users/edit.html.erb +27 -0
  83. data/spec/support/sample_app_rails_4/app/views/users/index.html.erb +10 -0
  84. data/spec/support/sample_app_rails_4/app/views/users/new.html.erb +24 -0
  85. data/spec/support/sample_app_rails_4/app/views/users/show.html.erb +24 -0
  86. data/spec/support/sample_app_rails_4/app/views/users/show_follow.html.erb +30 -0
  87. data/spec/support/sample_app_rails_4/bin/bundle +3 -0
  88. data/spec/support/sample_app_rails_4/bin/rails +4 -0
  89. data/spec/support/sample_app_rails_4/bin/rake +4 -0
  90. data/spec/support/sample_app_rails_4/config.ru +4 -0
  91. data/spec/support/sample_app_rails_4/config/application.rb +31 -0
  92. data/spec/support/sample_app_rails_4/config/boot.rb +4 -0
  93. data/spec/support/sample_app_rails_4/config/cucumber.yml +8 -0
  94. data/spec/support/sample_app_rails_4/config/database.yml +12 -0
  95. data/spec/support/sample_app_rails_4/config/environment.rb +7 -0
  96. data/spec/support/sample_app_rails_4/config/environments/development.rb +27 -0
  97. data/spec/support/sample_app_rails_4/config/environments/production.rb +79 -0
  98. data/spec/support/sample_app_rails_4/config/environments/test.rb +39 -0
  99. data/spec/support/sample_app_rails_4/config/initializers/backtrace_silencers.rb +7 -0
  100. data/spec/support/sample_app_rails_4/config/initializers/filter_parameter_logging.rb +4 -0
  101. data/spec/support/sample_app_rails_4/config/initializers/inflections.rb +16 -0
  102. data/spec/support/sample_app_rails_4/config/initializers/mime_types.rb +5 -0
  103. data/spec/support/sample_app_rails_4/config/initializers/secret_token.rb +22 -0
  104. data/spec/support/sample_app_rails_4/config/initializers/session_store.rb +3 -0
  105. data/spec/support/sample_app_rails_4/config/initializers/wrap_parameters.rb +14 -0
  106. data/spec/support/sample_app_rails_4/config/locales/en.yml +23 -0
  107. data/spec/support/sample_app_rails_4/config/routes.rb +17 -0
  108. data/spec/support/sample_app_rails_4/db/development.sqlite3 +0 -0
  109. data/spec/support/sample_app_rails_4/db/migrate/20130311191400_create_users.rb +10 -0
  110. data/spec/support/sample_app_rails_4/db/migrate/20130311194153_add_index_to_users_email.rb +5 -0
  111. data/spec/support/sample_app_rails_4/db/migrate/20130311201841_add_password_digest_to_users.rb +5 -0
  112. data/spec/support/sample_app_rails_4/db/migrate/20130314184954_add_remember_token_to_users.rb +6 -0
  113. data/spec/support/sample_app_rails_4/db/migrate/20130315015932_add_admin_to_users.rb +5 -0
  114. data/spec/support/sample_app_rails_4/db/migrate/20130315175534_create_microposts.rb +11 -0
  115. data/spec/support/sample_app_rails_4/db/migrate/20130315230445_create_relationships.rb +13 -0
  116. data/spec/support/sample_app_rails_4/db/migrate/20160424113439_create_comments.rb +8 -0
  117. data/spec/support/sample_app_rails_4/db/migrate/20160424113451_create_user_comments.rb +8 -0
  118. data/spec/support/sample_app_rails_4/db/migrate/20160424114701_create_organisations.rb +8 -0
  119. data/spec/support/sample_app_rails_4/db/migrate/20160424114727_add_organisation_id_to_users.rb +5 -0
  120. data/spec/support/sample_app_rails_4/db/schema.rb +67 -0
  121. data/spec/support/sample_app_rails_4/db/seeds.rb +7 -0
  122. data/spec/support/sample_app_rails_4/db/test.sqlite3 +0 -0
  123. data/spec/support/sample_app_rails_4/factory_girl.rb +7 -0
  124. data/spec/support/sample_app_rails_4/features/signing_in.feature +13 -0
  125. data/spec/support/sample_app_rails_4/features/step_definitions/authentication_steps.rb +30 -0
  126. data/spec/support/sample_app_rails_4/features/support/env.rb +59 -0
  127. data/spec/support/sample_app_rails_4/lib/assets/.keep +0 -0
  128. data/spec/support/sample_app_rails_4/lib/tasks/.keep +0 -0
  129. data/spec/support/sample_app_rails_4/lib/tasks/cucumber.rake +65 -0
  130. data/spec/support/sample_app_rails_4/lib/tasks/sample_data.rake +42 -0
  131. data/spec/support/sample_app_rails_4/log/.keep +0 -0
  132. data/spec/support/sample_app_rails_4/public/404.html +27 -0
  133. data/spec/support/sample_app_rails_4/public/422.html +26 -0
  134. data/spec/support/sample_app_rails_4/public/500.html +26 -0
  135. data/spec/support/sample_app_rails_4/public/assets/application-4962059d8f80f9bb096692bacc29c4e8.css +5091 -0
  136. data/spec/support/sample_app_rails_4/public/assets/application-4962059d8f80f9bb096692bacc29c4e8.css.gz +0 -0
  137. data/spec/support/sample_app_rails_4/public/assets/application-eeb856e3fe2c8f879c91d0e81d59cb40.js +12952 -0
  138. data/spec/support/sample_app_rails_4/public/assets/application-eeb856e3fe2c8f879c91d0e81d59cb40.js.gz +0 -0
  139. data/spec/support/sample_app_rails_4/public/assets/glyphicons-halflings-c806376f05e4ccabe2c5315a8e95667c.png +0 -0
  140. data/spec/support/sample_app_rails_4/public/assets/glyphicons-halflings-white-62b67d9edee3db90d18833087f848d6e.png +0 -0
  141. data/spec/support/sample_app_rails_4/public/assets/manifest-802de9eb1c853769101852422b620883.json +1 -0
  142. data/spec/support/sample_app_rails_4/public/assets/rails-231a680f23887d9dd70710ea5efd3c62.png +0 -0
  143. data/spec/support/sample_app_rails_4/public/favicon.ico +0 -0
  144. data/spec/support/sample_app_rails_4/public/robots.txt +5 -0
  145. data/spec/support/sample_app_rails_4/script/cucumber +10 -0
  146. data/spec/support/sample_app_rails_4/spec/controllers/relationships_controller_spec.rb +42 -0
  147. data/spec/support/sample_app_rails_4/spec/factories.rb +17 -0
  148. data/spec/support/sample_app_rails_4/spec/features/authentication_pages_spec.rb +155 -0
  149. data/spec/support/sample_app_rails_4/spec/features/micropost_pages_spec.rb +45 -0
  150. data/spec/support/sample_app_rails_4/spec/features/static_pages_spec.rb +64 -0
  151. data/spec/support/sample_app_rails_4/spec/features/user_pages_spec.rb +239 -0
  152. data/spec/support/sample_app_rails_4/spec/helpers/application_helper_spec.rb +18 -0
  153. data/spec/support/sample_app_rails_4/spec/models/comments_spec.rb +5 -0
  154. data/spec/support/sample_app_rails_4/spec/models/micropost_spec.rb +30 -0
  155. data/spec/support/sample_app_rails_4/spec/models/organisation_spec.rb +5 -0
  156. data/spec/support/sample_app_rails_4/spec/models/relationship_spec.rb +36 -0
  157. data/spec/support/sample_app_rails_4/spec/models/user_comments_spec.rb +5 -0
  158. data/spec/support/sample_app_rails_4/spec/models/user_spec.rb +108 -0
  159. data/spec/support/sample_app_rails_4/spec/spec_helper.rb +57 -0
  160. data/spec/support/sample_app_rails_4/spec/support/utilities.rb +21 -0
  161. data/spec/support/sample_app_rails_4/vendor/assets/javascripts/.keep +0 -0
  162. data/spec/support/sample_app_rails_4/vendor/assets/stylesheets/.keep +0 -0
  163. data/tasks/rspec.rake +4 -0
  164. metadata +534 -0
@@ -0,0 +1,11 @@
1
+ <li>
2
+ <span class="content"><%= micropost.content %></span>
3
+ <span class="timestamp">
4
+ Posted <%= time_ago_in_words(micropost.created_at) %> ago.
5
+ </span>
6
+ <% if current_user?(micropost.user) %>
7
+ <%= link_to "delete", micropost, method: :delete,
8
+ data: { confirm: "You sure?" },
9
+ title: micropost.content %>
10
+ <% end %>
11
+ </li>
@@ -0,0 +1,2 @@
1
+ $("#follow_form").html("<%= escape_javascript(render('users/unfollow')) %>")
2
+ $("#followers").html('<%= @user.followers.count %>')
@@ -0,0 +1,2 @@
1
+ $("#follow_form").html("<%= escape_javascript(render('users/follow')) %>")
2
+ $("#followers").html('<%= @user.followers.count %>')
@@ -0,0 +1,19 @@
1
+ <% provide(:title, "Sign in") %>
2
+ <h1>Sign in</h1>
3
+
4
+ <div class="row">
5
+ <div class="span6 offset3">
6
+ <%= form_for(:session, url: sessions_path) do |f| %>
7
+
8
+ <%= f.label :email %>
9
+ <%= f.text_field :email %>
10
+
11
+ <%= f.label :password %>
12
+ <%= f.password_field :password %>
13
+
14
+ <%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
15
+ <% end %>
16
+
17
+ <p>New user? <%= link_to "Sign up now!", signup_path %></p>
18
+ </div>
19
+ </div>
@@ -0,0 +1,12 @@
1
+ <% if object.errors.any? %>
2
+ <div id="error_explanation">
3
+ <div class="alert alert-error">
4
+ The form contains <%= pluralize(object.errors.count, "error") %>.
5
+ </div>
6
+ <ul>
7
+ <% object.errors.full_messages.each do |msg| %>
8
+ <li>* <%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <% if @feed_items.any? %>
2
+ <ol class="microposts">
3
+ <%= render partial: 'shared/feed_item', collection: @feed_items %>
4
+ </ol>
5
+ <%= will_paginate @feed_items %>
6
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <li id="<%= feed_item.id %>">
2
+ <%= link_to gravatar_for(feed_item.user), feed_item.user %>
3
+ <span class="user">
4
+ <%= link_to feed_item.user.name, feed_item.user %>
5
+ </span>
6
+ <span class="content"><%= feed_item.content %></span>
7
+ <span class="timestamp">
8
+ Posted <%= time_ago_in_words(feed_item.created_at) %> ago.
9
+ </span>
10
+ <% if current_user?(feed_item.user) %>
11
+ <%= link_to "delete", feed_item, method: :delete,
12
+ data: { confirm: "You sure?" },
13
+ title: feed_item.content %>
14
+ <% end %>
15
+ </li>
@@ -0,0 +1,7 @@
1
+ <%= form_for(@micropost) do |f| %>
2
+ <%= render 'shared/error_messages', object: f.object %>
3
+ <div class="field">
4
+ <%= f.text_area :content, placeholder: "Compose new micropost..." %>
5
+ </div>
6
+ <%= f.submit "Post", class: "btn btn-large btn-primary" %>
7
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% @user ||= current_user %>
2
+ <div class="stats">
3
+ <a href="<%= following_user_path(@user) %>">
4
+ <strong id="following" class="stat">
5
+ <%= @user.followed_users.count %>
6
+ </strong>
7
+ following
8
+ </a>
9
+ <a href="<%= followers_user_path(@user) %>">
10
+ <strong id="followers" class="stat">
11
+ <%= @user.followers.count %>
12
+ </strong>
13
+ followers
14
+ </a>
15
+ </div>
@@ -0,0 +1,12 @@
1
+ <a href="<%= user_path(current_user) %>">
2
+ <%= gravatar_for current_user, size: 52 %>
3
+ </a>
4
+ <h1>
5
+ <%= current_user.name %>
6
+ </h1>
7
+ <span>
8
+ <%= link_to "view my profile", current_user %>
9
+ </span>
10
+ <span>
11
+ <%= pluralize(current_user.microposts.count, "micropost") %>
12
+ </span>
@@ -0,0 +1,8 @@
1
+ <% provide(:title, 'About Us') %>
2
+ <h1>About Us</h1>
3
+ <p>
4
+ The <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
5
+ is a project to make a book and screencasts to teach web development
6
+ with <a href="http://rubyonrails.org/">Ruby on Rails</a>. This
7
+ is the sample application for the tutorial.
8
+ </p>
@@ -0,0 +1,6 @@
1
+ <% provide(:title, 'Contact') %>
2
+ <h1>Contact</h1>
3
+ <p>
4
+ Contact Ruby on Rails Tutorial about the sample app at the
5
+ <a href="http://railstutorial.org/contact">contact page</a>.
6
+ </p>
@@ -0,0 +1,8 @@
1
+ <% provide(:title, 'Help') %>
2
+ <h1>Help</h1>
3
+ <p>
4
+ Get help on the Ruby on Rails Tutorial at the
5
+ <a href="http://railstutorial.org/help">Rails Tutorial help page</a>.
6
+ To get help on this sample app, see the
7
+ <a href="http://railstutorial.org/book">Rails Tutorial book</a>.
8
+ </p>
@@ -0,0 +1,34 @@
1
+ <% if signed_in? %>
2
+ <div class="row">
3
+ <aside class="span4">
4
+ <section>
5
+ <%= render 'shared/user_info' %>
6
+ </section>
7
+ <section>
8
+ <%= render 'shared/stats' %>
9
+ </section>
10
+ <section>
11
+ <%= render 'shared/micropost_form' %>
12
+ </section>
13
+ </aside>
14
+ <div class="span8">
15
+ <h3>Micropost Feed</h3>
16
+ <%= render 'shared/feed' %>
17
+ </div>
18
+ </div>
19
+ <% else %>
20
+ <div class="center hero-unit">
21
+ <h1>Welcome to the Sample App</h1>
22
+
23
+ <h2>
24
+ This is the home page for the
25
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
26
+ sample application.
27
+ </h2>
28
+
29
+ <%= link_to "Sign up now!", signup_path,
30
+ class: "btn btn-large btn-primary" %>
31
+ </div>
32
+
33
+ <%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
34
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= form_for(current_user.relationships.build(followed_id: @user.id),
2
+ remote: true) do |f| %>
3
+ <div><%= f.hidden_field :followed_id %></div>
4
+ <%= f.submit "Follow", class: "btn btn-large btn-primary" %>
5
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% unless current_user?(@user) %>
2
+ <div id="follow_form">
3
+ <% if current_user.following?(@user) %>
4
+ <%= render 'unfollow' %>
5
+ <% else %>
6
+ <%= render 'follow' %>
7
+ <% end %>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= form_for(current_user.relationships.find_by(followed_id: @user.id),
2
+ html: { method: :delete },
3
+ remote: true) do |f| %>
4
+ <%= f.submit "Unfollow", class: "btn btn-large" %>
5
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <li>
2
+ <%= gravatar_for user, size: 52 %>
3
+ <%= link_to user.name, user %>
4
+ <% if current_user.admin? && !current_user?(user) %>
5
+ | <%= link_to "delete", user, method: :delete,
6
+ data: { confirm: "You sure?" } %>
7
+ <% end %>
8
+ </li>
@@ -0,0 +1,27 @@
1
+ <% provide(:title, "Edit user") %>
2
+ <h1>Update your profile</h1>
3
+
4
+ <div class="row">
5
+ <div class="span6 offset3">
6
+ <%= form_for(@user) do |f| %>
7
+ <%= render 'shared/error_messages', object: f.object %>
8
+
9
+ <%= f.label :name %>
10
+ <%= f.text_field :name %>
11
+
12
+ <%= f.label :email %>
13
+ <%= f.text_field :email %>
14
+
15
+ <%= f.label :password %>
16
+ <%= f.password_field :password %>
17
+
18
+ <%= f.label :password_confirmation, "Confirm Password" %>
19
+ <%= f.password_field :password_confirmation %>
20
+
21
+ <%= f.submit "Save changes", class: "btn btn-large btn-primary" %>
22
+ <% end %>
23
+
24
+ <%= gravatar_for @user %>
25
+ <a href="http://gravatar.com/emails">change</a>
26
+ </div>
27
+ </div>
@@ -0,0 +1,10 @@
1
+ <% provide(:title, 'All users') %>
2
+ <h1>All users</h1>
3
+
4
+ <%= will_paginate %>
5
+
6
+ <ul class="users">
7
+ <%= render @users %>
8
+ </ul>
9
+
10
+ <%= will_paginate %>
@@ -0,0 +1,24 @@
1
+ <% provide(:title, 'Sign up') %>
2
+ <h1>Sign up</h1>
3
+
4
+ <div class="row">
5
+ <div class="span6 offset3">
6
+ <%= form_for(@user) do |f| %>
7
+ <%= render 'shared/error_messages', object: f.object %>
8
+
9
+ <%= f.label :name %>
10
+ <%= f.text_field :name %>
11
+
12
+ <%= f.label :email %>
13
+ <%= f.text_field :email %>
14
+
15
+ <%= f.label :password %>
16
+ <%= f.password_field :password %>
17
+
18
+ <%= f.label :password_confirmation, "Confirmation" %>
19
+ <%= f.password_field :password_confirmation %>
20
+
21
+ <%= f.submit "Create my account", class: "btn btn-large btn-primary" %>
22
+ <% end %>
23
+ </div>
24
+ </div>
@@ -0,0 +1,24 @@
1
+ <% provide(:title, @user.name) %>
2
+ <div class="row">
3
+ <aside class="span4">
4
+ <section>
5
+ <h1>
6
+ <%= gravatar_for @user %>
7
+ <%= @user.name %>
8
+ </h1>
9
+ </section>
10
+ <section>
11
+ <%= render 'shared/stats' %>
12
+ </section>
13
+ </aside>
14
+ <div class="span8">
15
+ <%= render 'follow_form' if signed_in? %>
16
+ <% if @user.microposts.any? %>
17
+ <h3>Microposts (<%= @user.microposts.count %>)</h3>
18
+ <ol class="microposts">
19
+ <%= render @microposts %>
20
+ </ol>
21
+ <%= will_paginate @microposts %>
22
+ <% end %>
23
+ </div>
24
+ </div>
@@ -0,0 +1,30 @@
1
+ <% provide(:title, @title) %>
2
+ <div class="row">
3
+ <aside class="span4">
4
+ <section>
5
+ <%= gravatar_for @user %>
6
+ <h1><%= @user.name %></h1>
7
+ <span><%= link_to "view my profile", @user %></span>
8
+ <span><b>Microposts:</b> <%= @user.microposts.count %></span>
9
+ </section>
10
+ <section>
11
+ <%= render 'shared/stats' %>
12
+ <% if @users.any? %>
13
+ <div class="user_avatars">
14
+ <% @users.each do |user| %>
15
+ <%= link_to gravatar_for(user, size: 30), user %>
16
+ <% end %>
17
+ </div>
18
+ <% end %>
19
+ </section>
20
+ </aside>
21
+ <div class="span8">
22
+ <h3><%= @title %></h3>
23
+ <% if @users.any? %>
24
+ <ul class="users">
25
+ <%= render @users %>
26
+ </ul>
27
+ <%= will_paginate %>
28
+ <% end %>
29
+ </div>
30
+ </div>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -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 SampleApp::Application
@@ -0,0 +1,31 @@
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 "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ # Assets should be precompiled for production (so we don't need the gems loaded then)
11
+ Bundler.require(*Rails.groups(assets: %w(development test)))
12
+
13
+ module SampleApp
14
+ class Application < Rails::Application
15
+ # Settings in config/environments/* take precedence over those specified here.
16
+ # Application configuration should go into files in config/initializers
17
+ # -- all .rb files in that directory are automatically loaded.
18
+
19
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
20
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
21
+ # config.time_zone = 'Central Time (US & Canada)'
22
+
23
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
24
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
25
+ # config.i18n.default_locale = :de
26
+ # I18n.enforce_available_locales = true
27
+ I18n.enforce_available_locales = true
28
+
29
+ config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
30
+ end
31
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,12 @@
1
+ default: &default
2
+ adapter: sqlite3
3
+ pool: 5
4
+ timeout: 5000
5
+
6
+ development:
7
+ <<: *default
8
+ database: db/development.sqlite3
9
+
10
+ test:
11
+ <<: *default
12
+ database: db/test.sqlite3
@@ -0,0 +1,7 @@
1
+ # Load the rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ require 'rails_magic_renamer'
5
+
6
+ # Initialize the rails application.
7
+ SampleApp::Application.initialize!