rain 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -39
  3. data/lib/rain/capistrano.rb +2 -5
  4. data/lib/rain/deployer.rb +4 -10
  5. data/lib/rain/git_tools.rb +8 -2
  6. data/lib/rain/version.rb +1 -1
  7. metadata +36 -221
  8. data/lib/tasks/rain_tasks.rake +0 -5
  9. data/test/dummy/README.rdoc +0 -261
  10. data/test/dummy/Rakefile +0 -7
  11. data/test/dummy/app/assets/javascripts/application.js +0 -15
  12. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  13. data/test/dummy/app/controllers/application_controller.rb +0 -3
  14. data/test/dummy/app/helpers/application_helper.rb +0 -2
  15. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  16. data/test/dummy/config/application.rb +0 -59
  17. data/test/dummy/config/boot.rb +0 -10
  18. data/test/dummy/config/database.yml +0 -23
  19. data/test/dummy/config/environment.rb +0 -5
  20. data/test/dummy/config/environments/development.rb +0 -37
  21. data/test/dummy/config/environments/production.rb +0 -67
  22. data/test/dummy/config/environments/test.rb +0 -37
  23. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  24. data/test/dummy/config/initializers/inflections.rb +0 -15
  25. data/test/dummy/config/initializers/mime_types.rb +0 -5
  26. data/test/dummy/config/initializers/secret_token.rb +0 -7
  27. data/test/dummy/config/initializers/session_store.rb +0 -8
  28. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  29. data/test/dummy/config/locales/en.yml +0 -5
  30. data/test/dummy/config/routes.rb +0 -58
  31. data/test/dummy/config/versions.yml +0 -4
  32. data/test/dummy/config.ru +0 -4
  33. data/test/dummy/db/schema.rb +0 -16
  34. data/test/dummy/public/404.html +0 -26
  35. data/test/dummy/public/422.html +0 -26
  36. data/test/dummy/public/500.html +0 -25
  37. data/test/dummy/public/favicon.ico +0 -0
  38. data/test/dummy/script/rails +0 -6
  39. data/test/rain/config_test.rb +0 -13
  40. data/test/rain/deployer_test.rb +0 -49
  41. data/test/rain/git_tools/release_tag_test.rb +0 -21
  42. data/test/rain/git_tools_test.rb +0 -98
  43. data/test/rain_test.rb +0 -7
  44. data/test/test_helper.rb +0 -35
@@ -1,58 +0,0 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
8
-
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
-
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
- # resources :products
15
-
16
- # Sample resource route with options:
17
- # resources :products do
18
- # member do
19
- # get 'short'
20
- # post 'toggle'
21
- # end
22
- #
23
- # collection do
24
- # get 'sold'
25
- # end
26
- # end
27
-
28
- # Sample resource route with sub-resources:
29
- # resources :products do
30
- # resources :comments, :sales
31
- # resource :seller
32
- # end
33
-
34
- # Sample resource route with more complex sub-resources
35
- # resources :products do
36
- # resources :comments
37
- # resources :sales do
38
- # get 'recent', :on => :collection
39
- # end
40
- # end
41
-
42
- # Sample resource route within a namespace:
43
- # namespace :admin do
44
- # # Directs /admin/products/* to Admin::ProductsController
45
- # # (app/controllers/admin/products_controller.rb)
46
- # resources :products
47
- # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
- end
@@ -1,4 +0,0 @@
1
- ---
2
- stage: rel_0.0.1
3
- test: rel_0.0.1
4
- production: rel_0.0.1
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,16 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 0) do
15
-
16
- end
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,13 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Rain::ConfigTest < ActiveSupport::TestCase
4
- setup { @config = Rain::Config.new File.expand_path('./') }
5
-
6
- test "get YAML file" do
7
- refute_empty @config.yaml_file
8
- end
9
-
10
- test "creates a proper hash" do
11
- assert @config.versions.is_a? ActiveSupport::HashWithIndifferentAccess
12
- end
13
- end
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Rain::DeployerTest < ActiveSupport::TestCase
4
- describe "DeployerTest: bare invocation" do
5
- before { @command ||= %x(./bin/rain) }
6
-
7
- should "deploy to production" do
8
- assert_match 'Got a handful of stacks better grab an umbrella', @command
9
- end
10
- end
11
-
12
- describe "DeployerTest: specific environment invocation" do
13
- context "on stage" do
14
- before { @command ||= %x(./bin/rain on stage) }
15
-
16
- should "deploy a new tag to stage" do
17
- assert_match 'executing... git push origin rel_', @command
18
- end
19
- end
20
-
21
- context "on production" do
22
- before { @command ||= %x(./bin/rain on production) }
23
-
24
- should "deploy the same tag that's on stage to production" do
25
- assert_match 'Deploying existing tag', @command
26
- end
27
- end
28
- end
29
-
30
- describe "DeployerTest: help invocation for 'on'" do
31
- before { @command ||= %x(./bin/rain help on) }
32
-
33
- should "prompt for an environment" do
34
- assert_match 'rain on ENVIRONMENT', @command
35
- end
36
-
37
- should "be incrementable by patch version" do
38
- assert_match '--patch', @command
39
- end
40
-
41
- should "be incrementable by minor version" do
42
- assert_match '--minor', @command
43
- end
44
-
45
- should "be incrementable by major version" do
46
- assert_match '--major', @command
47
- end
48
- end
49
- end
@@ -1,21 +0,0 @@
1
- require 'test_helper'
2
-
3
- class GitTools::ReleaseTagTest < ActiveSupport::TestCase
4
- include GitTools
5
-
6
- describe "ReleaseTag: Comparison" do
7
- should "compare numerically with the other tag" do
8
- pre_release = ReleaseTag.new("rel_0.5.0.0")
9
- final_release = ReleaseTag.new("rel_1.0.0.0")
10
-
11
- refute_equal pre_release, final_release
12
-
13
- pre_release.major = 1
14
- pre_release.minor = 0
15
- pre_release.patch = 0
16
- pre_release.other = 0
17
-
18
- assert_equal pre_release, final_release
19
- end
20
- end
21
- end
@@ -1,98 +0,0 @@
1
- require 'test_helper'
2
- require 'rain/git_tools'
3
-
4
- class Rain::GitToolsTest < ActiveSupport::TestCase
5
- include GitTools
6
-
7
- describe "GitTools: working_directory_copasetic?" do
8
- should "return true when forced" do
9
- assert working_directory_copasetic?(force: true)
10
- end
11
- end
12
-
13
- describe "GitTools: on_master?" do
14
- should "return true when we are on the master branch" do
15
- assert %x(git checkout master > /dev/null), "master not checked out"
16
- assert on_master?
17
- end
18
-
19
- should "return false when we are on any other branch" do
20
- original_branch = %x(git branch | grep '*').gsub! /\*\s|\n/, ""
21
- assert_equal 'master', original_branch
22
- assert %x(git checkout -b some-branch > /dev/null), "some-branch not checked out"
23
- refute on_master?
24
-
25
- assert %x(git checkout #{original_branch} > /dev/null), "master not checked out"
26
- assert %x(git branch -d some-branch > /dev/null), "some-branch was not deleted"
27
- end
28
- end
29
-
30
- describe "GitTools: no_changes_pending?" do
31
- should "return false when there are uncommitted changes" do
32
- assert %x(echo "test" >> LICENSE.md), "LICENSE.md was not edited"
33
- refute no_changes_pending?, "LICENSE.md is still clean"
34
- assert %x(git checkout HEAD LICENSE.md), "LICENSE.md not reset to HEAD state"
35
- assert no_changes_pending?, "LICENSE.md is still dirty. Make sure you commit everything else!"
36
- end
37
- end
38
-
39
- describe "GitTools: last_release_tag" do
40
- setup { %x(git tag rel_9.9.999) }
41
-
42
- should "return the last release_tag entered into git" do
43
- assert_equal ReleaseTag.latest, last_release_tag
44
- end
45
-
46
- teardown { %x(git tag -d rel_9.9.999) }
47
- end
48
-
49
- describe "GitTools: git_name" do
50
- setup { @original_name = %x(git config user.name); %x(git config user.name "OJ Simpson") }
51
-
52
- should "return the name set in ~/.gitconfig" do
53
- assert_equal "OJ Simpson", git_name
54
- end
55
-
56
- teardown { %x(git config user.name "#{@original_name}") }
57
- end
58
-
59
- describe "GitTools: tagged_latest_version?" do
60
- setup { %x(git tag rel_0.0.1) }
61
-
62
- should "return true when the current tag and the latest-released tag are the same" do
63
- refute_nil ReleaseTag.current
64
- refute_nil ReleaseTag.latest
65
- assert tagged_latest_version?, "Latest version not tagged"
66
- end
67
-
68
- should "return false when the current tag has not been pushed" do
69
- assert %x(git tag rel_0.0.2), "Couldn't create latest tag"
70
- refute tagged_latest_version?, "Latest version tagged"
71
- assert %x(git tag -d rel_0.0.2), "Couldn't delete tag"
72
- end
73
-
74
- teardown { %x(git tag -d rel_0.0.1) }
75
- end
76
-
77
- #describe "GitTools: push_tag" do
78
- #should "push the tag to origin/master"
79
- #should "log an error if tag is nil"
80
- #end
81
-
82
- #describe "GitTools: run_cmd" do
83
- #should "execute the given shell command"
84
- #end
85
-
86
- #describe "GitTools: versions_path" do
87
- #should "return the full path to the versions.yml file"
88
- #end
89
-
90
- #describe "GitTools: versions_hash" do
91
- #should "return a YAML Hash of the versions.yml file"
92
- #end
93
-
94
- #describe "GitTools: update_release_tag" do
95
- #should "write the versions_hash to versions.yml"
96
- #should "commit and push that change to origin/master"
97
- #end
98
- end
data/test/rain_test.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class RainTest < ActiveSupport::TestCase
4
- test "be a module" do
5
- assert_kind_of Module, Rain
6
- end
7
- end
data/test/test_helper.rb DELETED
@@ -1,35 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- require 'bundler'
10
- Bundler.require :default, :development
11
-
12
- # Load support files
13
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
-
15
- # Load fixtures from the engine
16
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
17
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
- end
19
-
20
- class ActiveSupport::TestCase
21
- setup do
22
- %x(mkdir -p config)
23
- File.open File.expand_path('./config/versions.yml'), 'w' do |f|
24
- f.puts <<YAML
25
- ---
26
- stage: rel_0.0.1
27
- production: rel_0.0.1
28
- YAML
29
- end
30
- end
31
-
32
- teardown do
33
- %(rm -rf config/)
34
- end
35
- end