capistrano-fanfare 0.0.3 → 0.0.4
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.
- data/lib/capistrano/fanfare/assets.rb +13 -0
- data/lib/capistrano/fanfare/colors.rb +11 -0
- data/lib/capistrano/fanfare/database_yaml.rb +4 -0
- data/lib/capistrano/fanfare/defaults.rb +0 -1
- data/lib/capistrano/fanfare/foreman.rb +1 -0
- data/lib/capistrano/fanfare/version.rb +1 -1
- data/spec/assets_spec.rb +45 -0
- data/spec/colors_spec.rb +9 -0
- data/spec/defaults_spec.rb +0 -4
- data/spec/foreman_spec.rb +6 -0
- metadata +19 -13
| @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            require 'capistrano'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Capistrano::Fanfare::Assets
         | 
| 4 | 
            +
              def self.load_into(configuration)
         | 
| 5 | 
            +
                configuration.load do
         | 
| 6 | 
            +
                  load 'deploy/assets'
         | 
| 7 | 
            +
                end
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            if Capistrano::Configuration.instance
         | 
| 12 | 
            +
              Capistrano::Fanfare::Assets.load_into(Capistrano::Configuration.instance)
         | 
| 13 | 
            +
            end
         | 
| @@ -6,7 +6,6 @@ module Capistrano::Fanfare::Defaults | |
| 6 6 | 
             
                  set :scm,         :git
         | 
| 7 7 | 
             
                  set :use_sudo,    false
         | 
| 8 8 | 
             
                  set :user,        "deploy"
         | 
| 9 | 
            -
                  set :rake,        "bundle exec rake"
         | 
| 10 9 | 
             
                  set(:branch)      { ENV['BRANCH'] ? ENV['BRANCH'] : "master" }
         | 
| 11 10 | 
             
                  set(:deploy_to)   { "/srv/#{application}_#{deploy_env}" }
         | 
| 12 11 | 
             
                  set :ssh_options, { :forward_agent => true }
         | 
    
        data/spec/assets_spec.rb
    ADDED
    
    | @@ -0,0 +1,45 @@ | |
| 1 | 
            +
            require 'minitest/autorun'
         | 
| 2 | 
            +
            require 'minitest/capistrano'
         | 
| 3 | 
            +
            require 'capistrano/fanfare'
         | 
| 4 | 
            +
            require 'capistrano/fanfare/assets'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            #
         | 
| 7 | 
            +
            # Rake mixes in FileUtils methods into Capistrano::Configuration::Namespace as
         | 
| 8 | 
            +
            # private methods which will cause a method/task namespace collision when the
         | 
| 9 | 
            +
            # `deploy:assets:symlink' task is created.
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # So, if we are in a Rake context, nuke :symlink in the Namespace class--we
         | 
| 12 | 
            +
            # won't be using it directly in this codebase but this feels so very, very
         | 
| 13 | 
            +
            # wrong (here be dragons).
         | 
| 14 | 
            +
            #
         | 
| 15 | 
            +
            if defined?(Rake::DSL)
         | 
| 16 | 
            +
              Capistrano::Configuration::Namespaces::Namespace.class_eval { undef :symlink }
         | 
| 17 | 
            +
            end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            describe Capistrano::Fanfare::Assets do
         | 
| 20 | 
            +
              before do
         | 
| 21 | 
            +
                @config = Capistrano::Configuration.new
         | 
| 22 | 
            +
                Capistrano::Fanfare::Assets.load_into(@config)
         | 
| 23 | 
            +
                @config.extend(MiniTest::Capistrano::ConfigurationExtension)
         | 
| 24 | 
            +
                # @orig_config = Capistrano::Configuration.instance
         | 
| 25 | 
            +
                # Capistrano::Configuration.instance = @config
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              after do
         | 
| 29 | 
            +
                # Capistrano::Configuration.instance = @orig_config
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
              describe "for namespace :deploy" do
         | 
| 33 | 
            +
                it "creates a deploy:assets:symlink task" do
         | 
| 34 | 
            +
                  @config.must_have_task "deploy:assets:symlink"
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                it "creates a deploy:assets:precompile task" do
         | 
| 38 | 
            +
                  @config.must_have_task "deploy:assets:precompile"
         | 
| 39 | 
            +
                end
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                it "creates a deploy:assets:clean task" do
         | 
| 42 | 
            +
                  @config.must_have_task "deploy:assets:clean"
         | 
| 43 | 
            +
                end
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
            end
         | 
    
        data/spec/colors_spec.rb
    ADDED
    
    | @@ -0,0 +1,9 @@ | |
| 1 | 
            +
            require 'minitest/autorun'
         | 
| 2 | 
            +
            require 'minitest/capistrano'
         | 
| 3 | 
            +
            require 'capistrano/fanfare'
         | 
| 4 | 
            +
            require 'capistrano/fanfare/colors'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            describe Capistrano::Fanfare::Colors do
         | 
| 7 | 
            +
              # This recipe is not being tested as it patches Capistrano's log
         | 
| 8 | 
            +
              # method and causes random failures in the rest of the test suite.
         | 
| 9 | 
            +
            end
         | 
    
        data/spec/defaults_spec.rb
    CHANGED
    
    | @@ -23,10 +23,6 @@ describe Capistrano::Fanfare::Defaults do | |
| 23 23 | 
             
                @config.fetch(:user).must_equal "deploy"
         | 
| 24 24 | 
             
              end
         | 
| 25 25 |  | 
| 26 | 
            -
              it "sets :rake to 'bundle exec rake'" do
         | 
| 27 | 
            -
                @config.fetch(:rake).must_equal "bundle exec rake"
         | 
| 28 | 
            -
              end
         | 
| 29 | 
            -
             | 
| 30 26 | 
             
              it "sets :ssh_options to include :forward_agent => true" do
         | 
| 31 27 | 
             
                @config.fetch(:ssh_options)[:forward_agent].must_equal true
         | 
| 32 28 | 
             
              end
         | 
    
        data/spec/foreman_spec.rb
    CHANGED
    
    | @@ -26,6 +26,12 @@ describe Capistrano::Fanfare::Foreman do | |
| 26 26 | 
             
                  @config.fetch(:foreman_cmd).must_equal "foreman"
         | 
| 27 27 | 
             
                end
         | 
| 28 28 |  | 
| 29 | 
            +
                it "sets :rake to ':foreman_cmd run rake'" do
         | 
| 30 | 
            +
                  @config.set :foreman_cmd, "bin/foreman"
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                  @config.fetch(:rake).must_equal "bin/foreman run rake"
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
             | 
| 29 35 | 
             
                it "sets :foreman_export_via to :runit" do
         | 
| 30 36 | 
             
                  @config.fetch(:foreman_export_via).must_equal :runit
         | 
| 31 37 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capistrano-fanfare
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -13,7 +13,7 @@ date: 2012-01-19 00:00:00.000000000 Z | |
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: capistrano
         | 
| 16 | 
            -
              requirement: & | 
| 16 | 
            +
              requirement: &70116851192820 !ruby/object:Gem::Requirement
         | 
| 17 17 | 
             
                none: false
         | 
| 18 18 | 
             
                requirements:
         | 
| 19 19 | 
             
                - - =
         | 
| @@ -21,10 +21,10 @@ dependencies: | |
| 21 21 | 
             
                    version: 2.10.0.pre
         | 
| 22 22 | 
             
              type: :runtime
         | 
| 23 23 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements: * | 
| 24 | 
            +
              version_requirements: *70116851192820
         | 
| 25 25 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 26 26 | 
             
              name: capistrano_colors
         | 
| 27 | 
            -
              requirement: & | 
| 27 | 
            +
              requirement: &70116851192120 !ruby/object:Gem::Requirement
         | 
| 28 28 | 
             
                none: false
         | 
| 29 29 | 
             
                requirements:
         | 
| 30 30 | 
             
                - - ~>
         | 
| @@ -32,10 +32,10 @@ dependencies: | |
| 32 32 | 
             
                    version: '0.5'
         | 
| 33 33 | 
             
              type: :runtime
         | 
| 34 34 | 
             
              prerelease: false
         | 
| 35 | 
            -
              version_requirements: * | 
| 35 | 
            +
              version_requirements: *70116851192120
         | 
| 36 36 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 37 | 
             
              name: minitest
         | 
| 38 | 
            -
              requirement: & | 
| 38 | 
            +
              requirement: &70116851191300 !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                none: false
         | 
| 40 40 | 
             
                requirements:
         | 
| 41 41 | 
             
                - - ~>
         | 
| @@ -43,10 +43,10 @@ dependencies: | |
| 43 43 | 
             
                    version: 2.10.0
         | 
| 44 44 | 
             
              type: :development
         | 
| 45 45 | 
             
              prerelease: false
         | 
| 46 | 
            -
              version_requirements: * | 
| 46 | 
            +
              version_requirements: *70116851191300
         | 
| 47 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 48 48 | 
             
              name: minitest-capistrano
         | 
| 49 | 
            -
              requirement: & | 
| 49 | 
            +
              requirement: &70116851190600 !ruby/object:Gem::Requirement
         | 
| 50 50 | 
             
                none: false
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - ~>
         | 
| @@ -54,10 +54,10 @@ dependencies: | |
| 54 54 | 
             
                    version: '0.0'
         | 
| 55 55 | 
             
              type: :development
         | 
| 56 56 | 
             
              prerelease: false
         | 
| 57 | 
            -
              version_requirements: * | 
| 57 | 
            +
              version_requirements: *70116851190600
         | 
| 58 58 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 59 59 | 
             
              name: timecop
         | 
| 60 | 
            -
              requirement: & | 
| 60 | 
            +
              requirement: &70116851189820 !ruby/object:Gem::Requirement
         | 
| 61 61 | 
             
                none: false
         | 
| 62 62 | 
             
                requirements:
         | 
| 63 63 | 
             
                - - ~>
         | 
| @@ -65,7 +65,7 @@ dependencies: | |
| 65 65 | 
             
                    version: '0.3'
         | 
| 66 66 | 
             
              type: :development
         | 
| 67 67 | 
             
              prerelease: false
         | 
| 68 | 
            -
              version_requirements: * | 
| 68 | 
            +
              version_requirements: *70116851189820
         | 
| 69 69 | 
             
            description: Capistrano recipes (with full test suite) for fanfare application deployment
         | 
| 70 70 | 
             
              framework
         | 
| 71 71 | 
             
            email:
         | 
| @@ -82,7 +82,9 @@ files: | |
| 82 82 | 
             
            - Rakefile
         | 
| 83 83 | 
             
            - capistrano-fanfare.gemspec
         | 
| 84 84 | 
             
            - lib/capistrano/fanfare.rb
         | 
| 85 | 
            +
            - lib/capistrano/fanfare/assets.rb
         | 
| 85 86 | 
             
            - lib/capistrano/fanfare/bundler.rb
         | 
| 87 | 
            +
            - lib/capistrano/fanfare/colors.rb
         | 
| 86 88 | 
             
            - lib/capistrano/fanfare/database_yaml.rb
         | 
| 87 89 | 
             
            - lib/capistrano/fanfare/defaults.rb
         | 
| 88 90 | 
             
            - lib/capistrano/fanfare/foreman.rb
         | 
| @@ -93,7 +95,9 @@ files: | |
| 93 95 | 
             
            - lib/capistrano/fanfare/multistage.rb
         | 
| 94 96 | 
             
            - lib/capistrano/fanfare/version.rb
         | 
| 95 97 | 
             
            - lib/capistrano/recipes/deploy/strategy/git_style.rb
         | 
| 98 | 
            +
            - spec/assets_spec.rb
         | 
| 96 99 | 
             
            - spec/bundler_spec.rb
         | 
| 100 | 
            +
            - spec/colors_spec.rb
         | 
| 97 101 | 
             
            - spec/database_yaml_spec.rb
         | 
| 98 102 | 
             
            - spec/defaults_spec.rb
         | 
| 99 103 | 
             
            - spec/fixtures/Procfile
         | 
| @@ -119,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 119 123 | 
             
                  version: '0'
         | 
| 120 124 | 
             
                  segments:
         | 
| 121 125 | 
             
                  - 0
         | 
| 122 | 
            -
                  hash: - | 
| 126 | 
            +
                  hash: -31402072217329006
         | 
| 123 127 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 124 128 | 
             
              none: false
         | 
| 125 129 | 
             
              requirements:
         | 
| @@ -128,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 128 132 | 
             
                  version: '0'
         | 
| 129 133 | 
             
                  segments:
         | 
| 130 134 | 
             
                  - 0
         | 
| 131 | 
            -
                  hash: - | 
| 135 | 
            +
                  hash: -31402072217329006
         | 
| 132 136 | 
             
            requirements: []
         | 
| 133 137 | 
             
            rubyforge_project: 
         | 
| 134 138 | 
             
            rubygems_version: 1.8.10
         | 
| @@ -137,7 +141,9 @@ specification_version: 3 | |
| 137 141 | 
             
            summary: Capistrano recipes (with full test suite) for fanfare application deployment
         | 
| 138 142 | 
             
              framework
         | 
| 139 143 | 
             
            test_files:
         | 
| 144 | 
            +
            - spec/assets_spec.rb
         | 
| 140 145 | 
             
            - spec/bundler_spec.rb
         | 
| 146 | 
            +
            - spec/colors_spec.rb
         | 
| 141 147 | 
             
            - spec/database_yaml_spec.rb
         | 
| 142 148 | 
             
            - spec/defaults_spec.rb
         | 
| 143 149 | 
             
            - spec/fixtures/Procfile
         |