Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit a88a68656e77ebd4e06bce2cc593297c2c46f4a9 @ryanb ryanb committed Aug 31, 2012
Showing with 2,458 additions and 0 deletions.
  1. +40 −0 README.md
  2. +16 −0 blog-after/.gitignore
  3. +1 −0 blog-after/.rbenv-version
  4. +4 −0 blog-after/Capfile
  5. +46 −0 blog-after/Gemfile
  6. +148 −0 blog-after/Gemfile.lock
  7. +12 −0 blog-after/README.md
  8. +7 −0 blog-after/Rakefile
  9. +15 −0 blog-after/app/assets/javascripts/application.js
  10. +3 −0 blog-after/app/assets/javascripts/articles.js.coffee
  11. +13 −0 blog-after/app/assets/stylesheets/application.css
  12. +16 −0 blog-after/app/assets/stylesheets/articles.css.scss
  13. +71 −0 blog-after/app/assets/stylesheets/layout.css.scss
  14. +3 −0 blog-after/app/controllers/application_controller.rb
  15. +22 −0 blog-after/app/controllers/articles_controller.rb
  16. +2 −0 blog-after/app/helpers/application_helper.rb
  17. +2 −0 blog-after/app/helpers/articles_helper.rb
  18. 0 blog-after/app/mailers/.gitkeep
  19. 0 blog-after/app/models/.gitkeep
  20. +3 −0 blog-after/app/models/article.rb
  21. +11 −0 blog-after/app/views/articles/index.html.erb
  22. +30 −0 blog-after/app/views/articles/new.html.erb
  23. +7 −0 blog-after/app/views/articles/show.html.erb
  24. +17 −0 blog-after/app/views/layouts/application.html.erb
  25. +4 −0 blog-after/config.ru
  26. +64 −0 blog-after/config/application.rb
  27. +6 −0 blog-after/config/boot.rb
  28. +55 −0 blog-after/config/database.example.yml
  29. +33 −0 blog-after/config/deploy.rb
  30. +5 −0 blog-after/config/environment.rb
  31. +37 −0 blog-after/config/environments/development.rb
  32. +67 −0 blog-after/config/environments/production.rb
  33. +37 −0 blog-after/config/environments/test.rb
  34. +7 −0 blog-after/config/initializers/backtrace_silencers.rb
  35. +15 −0 blog-after/config/initializers/inflections.rb
  36. +5 −0 blog-after/config/initializers/mime_types.rb
  37. +7 −0 blog-after/config/initializers/secret_token.rb
  38. +8 −0 blog-after/config/initializers/session_store.rb
  39. +14 −0 blog-after/config/initializers/wrap_parameters.rb
  40. +5 −0 blog-after/config/locales/en.yml
  41. +16 −0 blog-after/config/recipes/base.rb
  42. +23 −0 blog-after/config/recipes/nginx.rb
  43. +33 −0 blog-after/config/recipes/postgresql.rb
  44. +27 −0 blog-after/config/recipes/rbenv.rb
  45. +23 −0 blog-after/config/recipes/templates/nginx.erb
  46. +8 −0 blog-after/config/recipes/templates/postgresql.yml.erb
  47. +51 −0 blog-after/config/recipes/trinidad.rb
  48. +4 −0 blog-after/config/routes.rb
  49. +11 −0 blog-after/db/migrate/20120806171740_create_articles.rb
  50. +24 −0 blog-after/db/schema.rb
  51. +19 −0 blog-after/db/seeds.rb
  52. +2 −0 blog-after/doc/README_FOR_APP
  53. 0 blog-after/lib/assets/.gitkeep
  54. 0 blog-after/lib/tasks/.gitkeep
  55. 0 blog-after/log/.gitkeep
  56. +26 −0 blog-after/public/404.html
  57. +26 −0 blog-after/public/422.html
  58. +25 −0 blog-after/public/500.html
  59. 0 blog-after/public/favicon.ico
  60. +5 −0 blog-after/public/robots.txt
  61. +6 −0 blog-after/script/rails
  62. 0 blog-after/test/fixtures/.gitkeep
  63. +9 −0 blog-after/test/fixtures/articles.yml
  64. 0 blog-after/test/functional/.gitkeep
  65. +49 −0 blog-after/test/functional/articles_controller_test.rb
  66. 0 blog-after/test/integration/.gitkeep
  67. +12 −0 blog-after/test/performance/browsing_test.rb
  68. +13 −0 blog-after/test/test_helper.rb
  69. 0 blog-after/test/unit/.gitkeep
  70. +7 −0 blog-after/test/unit/article_test.rb
  71. +4 −0 blog-after/test/unit/helpers/articles_helper_test.rb
  72. 0 blog-after/vendor/assets/javascripts/.gitkeep
  73. 0 blog-after/vendor/assets/stylesheets/.gitkeep
  74. 0 blog-after/vendor/plugins/.gitkeep
  75. +16 −0 blog-before/.gitignore
  76. +1 −0 blog-before/.rbenv-version
  77. +4 −0 blog-before/Capfile
  78. +46 −0 blog-before/Gemfile
  79. +142 −0 blog-before/Gemfile.lock
  80. +12 −0 blog-before/README.md
  81. +7 −0 blog-before/Rakefile
  82. +15 −0 blog-before/app/assets/javascripts/application.js
  83. +3 −0 blog-before/app/assets/javascripts/articles.js.coffee
  84. +13 −0 blog-before/app/assets/stylesheets/application.css
  85. +16 −0 blog-before/app/assets/stylesheets/articles.css.scss
  86. +71 −0 blog-before/app/assets/stylesheets/layout.css.scss
  87. +3 −0 blog-before/app/controllers/application_controller.rb
  88. +22 −0 blog-before/app/controllers/articles_controller.rb
  89. +2 −0 blog-before/app/helpers/application_helper.rb
  90. +2 −0 blog-before/app/helpers/articles_helper.rb
  91. 0 blog-before/app/mailers/.gitkeep
  92. 0 blog-before/app/models/.gitkeep
  93. +3 −0 blog-before/app/models/article.rb
  94. +11 −0 blog-before/app/views/articles/index.html.erb
  95. +30 −0 blog-before/app/views/articles/new.html.erb
  96. +7 −0 blog-before/app/views/articles/show.html.erb
  97. +17 −0 blog-before/app/views/layouts/application.html.erb
  98. +4 −0 blog-before/config.ru
  99. +64 −0 blog-before/config/application.rb
  100. +6 −0 blog-before/config/boot.rb
  101. +55 −0 blog-before/config/database.example.yml
  102. +32 −0 blog-before/config/deploy.rb
  103. +5 −0 blog-before/config/environment.rb
  104. +37 −0 blog-before/config/environments/development.rb
  105. +67 −0 blog-before/config/environments/production.rb
  106. +37 −0 blog-before/config/environments/test.rb
  107. +7 −0 blog-before/config/initializers/backtrace_silencers.rb
  108. +15 −0 blog-before/config/initializers/inflections.rb
  109. +5 −0 blog-before/config/initializers/mime_types.rb
  110. +7 −0 blog-before/config/initializers/secret_token.rb
  111. +8 −0 blog-before/config/initializers/session_store.rb
  112. +14 −0 blog-before/config/initializers/wrap_parameters.rb
  113. +5 −0 blog-before/config/locales/en.yml
  114. +16 −0 blog-before/config/recipes/base.rb
  115. +23 −0 blog-before/config/recipes/nginx.rb
  116. +33 −0 blog-before/config/recipes/postgresql.rb
  117. +27 −0 blog-before/config/recipes/rbenv.rb
  118. +17 −0 blog-before/config/recipes/templates/nginx.erb
  119. +8 −0 blog-before/config/recipes/templates/postgresql.yml.erb
  120. +4 −0 blog-before/config/routes.rb
  121. +11 −0 blog-before/db/migrate/20120806171740_create_articles.rb
  122. +24 −0 blog-before/db/schema.rb
  123. +19 −0 blog-before/db/seeds.rb
  124. +2 −0 blog-before/doc/README_FOR_APP
  125. 0 blog-before/lib/assets/.gitkeep
  126. 0 blog-before/lib/tasks/.gitkeep
  127. 0 blog-before/log/.gitkeep
  128. +26 −0 blog-before/public/404.html
  129. +26 −0 blog-before/public/422.html
  130. +25 −0 blog-before/public/500.html
  131. 0 blog-before/public/favicon.ico
  132. +5 −0 blog-before/public/robots.txt
  133. +6 −0 blog-before/script/rails
  134. 0 blog-before/test/fixtures/.gitkeep
  135. +9 −0 blog-before/test/fixtures/articles.yml
  136. 0 blog-before/test/functional/.gitkeep
  137. +49 −0 blog-before/test/functional/articles_controller_test.rb
  138. 0 blog-before/test/integration/.gitkeep
  139. +12 −0 blog-before/test/performance/browsing_test.rb
  140. +13 −0 blog-before/test/test_helper.rb
  141. 0 blog-before/test/unit/.gitkeep
  142. +7 −0 blog-before/test/unit/article_test.rb
  143. +4 −0 blog-before/test/unit/helpers/articles_helper_test.rb
  144. 0 blog-before/vendor/assets/javascripts/.gitkeep
  145. 0 blog-before/vendor/assets/stylesheets/.gitkeep
  146. 0 blog-before/vendor/plugins/.gitkeep
@@ -0,0 +1,40 @@
+# RailsCasts Episode #377: Trinidad
+
+http://railscasts.com/episodes/377-trinidad
+
+Requires Ruby 1.9.2 or higher.
+
+
+### Commands used in this episode
+
+```
+ssh root@198.58.96.26
+adduser deployer
+echo "deployer ALL=(ALL:ALL) ALL" >> /etc/sudoers
+exit
+ssh-copy-id deployer@198.58.96.26
+cap deploy:install
+cap deploy:setup
+cap deploy:cold
+bundle exec rails s trinidad -e production
+cap nginx:setup
+cap trinidad:setup
+touch tmp/restart.txt
+cap deploy trinidad:restart
+```
+
+### Gotchas
+
+* **Highline Version:** If you are using JRuby 1.7 and receiving the exception `NameError: cannot load Java class jline.ConsoleReader` while running Capistrano commands then try running `bundle update highline`. This was fixed in Highline version to 1.6.14. See [this issue](https://github.com/JEG2/highline/issues/41) for details.
+
+* **SSH Agent Forwarding:** If Capistrano hangs while deploying, check to see if the `ssh_options[:forward_agent] = true` is in the Capistrano config. This may not work as [discussed here](http://jira.codehaus.org/browse/JRUBY-6181). Here are some solutions.
+
+ * Authorize the server directly by generating an SSH key and setting it up as [the deploy key](https://help.github.com/articles/managing-deploy-keys).
+
+ * Consider running Capistrano commands from Ruby MRI on your local.
+
+ * Use an alternative deployment method such as "copy"
+
+ * Try upgrading to JRuby 7 on your local machine, this has been reported to solve the issue but I have not tested it.
+
+* **Not Reloading:** I experienced an issue where running `touch tmp/restart.txt` on the server would not use the latest code. Unfortunately I was unable to reproduce this problem consistently enough to resolve it. If you experience this, please [comment on this issue](https://github.com/trinidad/trinidad/issues/84).
@@ -0,0 +1,16 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+config/database.yml
@@ -0,0 +1 @@
+jruby-1.7.0-preview2
@@ -0,0 +1,4 @@
+load 'deploy'
+load 'deploy/assets'
+Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -0,0 +1,46 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.8'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+platform :jruby do
+ gem 'activerecord-jdbcpostgresql-adapter'
+ gem 'jruby-openssl'
+ gem 'therubyrhino', group: :assets
+ gem 'trinidad', require: false
+end
+
+platform :ruby do
+ gem 'pg'
+end
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platforms => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+gem 'capistrano'
+
+# To use debugger
+# gem 'debugger'
@@ -0,0 +1,148 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.8)
+ actionpack (= 3.2.8)
+ mail (~> 2.4.4)
+ actionpack (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ activerecord (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activerecord-jdbc-adapter (1.2.2)
+ activerecord-jdbcpostgresql-adapter (1.2.2)
+ activerecord-jdbc-adapter (~> 1.2.2)
+ jdbc-postgres (>= 9.0, < 9.2)
+ activeresource (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ activesupport (3.2.8)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bouncy-castle-java (1.5.0146.1)
+ builder (3.0.0)
+ capistrano (2.13.3)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ highline (1.6.14)
+ hike (1.2.1)
+ i18n (0.6.0)
+ jdbc-postgres (9.1.901)
+ journey (1.0.4)
+ jquery-rails (2.1.1)
+ railties (>= 3.1.0, < 5.0)
+ thor (~> 0.14)
+ jruby-openssl (0.7.7)
+ bouncy-castle-java (>= 1.5.0146.1)
+ jruby-rack (1.1.9)
+ json (1.7.5)
+ json (1.7.5-java)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.3.6)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-sftp (2.0.5)
+ net-ssh (>= 2.0.9)
+ net-ssh (2.5.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ pg (0.14.0)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.8)
+ actionmailer (= 3.2.8)
+ actionpack (= 3.2.8)
+ activerecord (= 3.2.8)
+ activeresource (= 3.2.8)
+ activesupport (= 3.2.8)
+ bundler (~> 1.0)
+ railties (= 3.2.8)
+ railties (3.2.8)
+ actionpack (= 3.2.8)
+ activesupport (= 3.2.8)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.2.1)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ therubyrhino (2.0.1)
+ therubyrhino_jar (>= 1.7.3)
+ therubyrhino_jar (1.7.4)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ trinidad (1.4.1)
+ jruby-rack (>= 1.1.7)
+ trinidad_jars (>= 1.0.5)
+ trinidad_jars (1.0.6)
+ tzinfo (0.3.33)
+ uglifier (1.2.7)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.3)
+
+PLATFORMS
+ java
+ ruby
+
+DEPENDENCIES
+ activerecord-jdbcpostgresql-adapter
+ capistrano
+ coffee-rails (~> 3.2.1)
+ jquery-rails
+ jruby-openssl
+ pg
+ rails (= 3.2.8)
+ sass-rails (~> 3.2.3)
+ therubyrhino
+ trinidad
+ uglifier (>= 1.0.3)
@@ -0,0 +1,12 @@
+# RailsCasts Example Application
+
+Run these commands to try it out.
+
+```
+bundle
+cp config/database.example.yml config/database.yml
+rake db:create db:setup
+rails s
+```
+
+Requires Ruby 1.9.2 or later to run.
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Blog::Application.load_tasks
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
@@ -0,0 +1,16 @@
+// Place all the styles related to the articles controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+
+#articles {
+ h2 {
+ font-size: 18px;
+ margin-top: 20px;
+ margin-bottom: 5px;
+ }
+ p { margin: 5px 0; }
+ .info {
+ font-style: italic;
+ font-size: 12px;
+ }
+}
Oops, something went wrong.

0 comments on commit a88a686

Please sign in to comment.