capistrano-phpcachetool 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTNiMTg2YzAwNGM0MGFmZGQ4MGE4ZDVhNmQyNDU1NzhmMTJmMjk5Nw==
5
+ data.tar.gz: !binary |-
6
+ YWI0MzdiYzhmMGE2MDNjODBjNGIwZjM3NmM0Yzk1OTIwZGUwYjgwNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDk2NGEzOTgyMjg1M2ZlZWE1YmQyNDRhMTdkNzZhNThhNDBlOTk4NzgyMjM0
10
+ MTNhNWIxODNlMDIwNWZkZGQ2MTI3Zjg3Mzc1ZWU2ODA3MTJlNDRlNTllMjE3
11
+ OTY1YjcwZmU2ZmM5YWYyNzQ0Njc2ZDhmMzIyYTY4OTJiMzJhYzY=
12
+ data.tar.gz: !binary |-
13
+ Y2Q0OWMwNTc3MTdiNzI1ZWRmMjUyYjg5OThkMjQ2ZDYwYTQzMDdiOTUxZDk0
14
+ NmUxOThmNGYzYTA3NGU2OTViYzZmODJkNTBhZTJmMjM5YWIwYTk1NjAyYWQ1
15
+ NDM3YzViZWY5OGJhMGVkNTNmNGJjNjAwYTBhZjk0NWIxNzQ1ZjM=
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.swp
13
+ *.o
14
+ *.a
15
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-phpcachetool.gemspec
4
+ gemspec
5
+
6
+ gem 'rspec'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Yuri Karamani
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Capistrano::Phpcachetool
2
+
3
+ Cachetool support for Capistrano 3.x
4
+
5
+ See: https://github.com/gordalina/cachetool
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-phpcachetool'
13
+ ```
14
+
15
+ And then execute
16
+ ```
17
+ $ bundle
18
+ ```
19
+
20
+ Or install it yourself as:
21
+
22
+ ```
23
+ $ gem install capistrano-phpcachetool
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Require the module in your Capfile:
29
+
30
+ ```ruby
31
+ require 'capistrano/phpcachetool'
32
+ ```
33
+
34
+ The `cachetool:reset` task will run after deploy:symlink:release as part of Capistrano default deploy.
35
+
36
+ ## Configuration
37
+
38
+ ```ruby
39
+ set :cachetool_reset_flags, '--fcgi'
40
+ set :cachetool_roles, :all
41
+ set :cachetool_lib, :all
42
+ set :cachetool_working_dir, -> { fetch(:release_path) }
43
+ set :cachetool_download_url, "http://gordalina.github.io/cachetool/downloads/cachetool.phar"
44
+ ```
45
+
46
+ ## Contributing
47
+
48
+ 1. Fork it ( https://github.com/karamani/capistrano-phpcachetool/fork )
49
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
50
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
51
+ 4. Push to the branch (`git push origin my-new-feature`)
52
+ 5. Create a new Pull Request
53
+
54
+ ## Installing composer as part of a deployment
55
+
56
+ Add the following to deploy.rb to manage the installation of cachetool during deployment (cachetool.phar is install in the shared path).
57
+
58
+ ```ruby
59
+ SSHKit.config.command_map[:cachetool] = "php #{shared_path.join("cachetool.phar")}"
60
+
61
+ namespace :deploy do
62
+ after :starting, 'cachetool:install_executable'
63
+ end
64
+ ```
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/phpcachetool/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-phpcachetool"
8
+ spec.version = Capistrano::Phpcachetool::VERSION
9
+ spec.authors = ["Yuri Karamani"]
10
+ spec.email = ["y.karamani@gmail.com"]
11
+ spec.summary = %q{Capistrano 3 plugin for work with php cache.}
12
+ spec.description = %q{}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/cachetool.rake', __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Phpcachetool
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,51 @@
1
+ namespace :cachetool do
2
+ desc <<-DESC
3
+ Installs cachetool.phar to the shared directory
4
+ In order to use the .phar file, the cachetool command needs to be mapped:
5
+ SSHKit.config.command_map[:cachetool] = "\#{shared_path.join("cachetool.phar")}"
6
+ This is best used after deploy:starting:
7
+ namespace :deploy do
8
+ after :starting, 'cachetool:install_executable'
9
+ end
10
+ DESC
11
+ task :install_executable do
12
+ on release_roles(fetch(:cachetool_roles)) do
13
+ within shared_path do
14
+ unless test "[", "-e", "cachetool.phar", "]"
15
+ execute :curl, "-sO", fetch(:cachetool_download_url)
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ task :run, :command do |t, args|
22
+ args.with_defaults(:command => :list)
23
+ on release_roles(fetch(:cachetool_roles)) do
24
+ within fetch(:cachetool_working_dir) do
25
+ execute :cachetool, args[:command], *args.extras
26
+ end
27
+ end
28
+ end
29
+
30
+ task :reset do
31
+ if [:all, :apc].include? fetch(:cachetool_lib)
32
+ Rake::Task["cachetool:run"].invoke "apc:cache:clear all", fetch(:cachetool_reset_flags)
33
+ end
34
+ if [:all, :opcache].include? fetch(:cachetool_lib)
35
+ Rake::Task["cachetool:run"].reenable
36
+ Rake::Task["cachetool:run"].invoke "opcache:reset", fetch(:cachetool_reset_flags)
37
+ end
38
+ end
39
+
40
+ after 'deploy:symlink:release', 'cachetool:reset'
41
+ end
42
+
43
+ namespace :load do
44
+ task :defaults do
45
+ set :cachetool_reset_flags, '--fcgi'
46
+ set :cachetool_roles, :all
47
+ set :cachetool_lib, :all
48
+ set :cachetool_working_dir, -> { fetch(:release_path) }
49
+ set :cachetool_download_url, "http://gordalina.github.io/cachetool/downloads/cachetool.phar"
50
+ end
51
+ end
@@ -0,0 +1,91 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # This setting enables warnings. It's recommended, but in some cases may
61
+ # be too noisy due to issues in dependencies.
62
+ config.warnings = true
63
+
64
+ # Many RSpec users commonly either run the entire suite or an individual
65
+ # file, and it's useful to allow more verbose output when running an
66
+ # individual spec file.
67
+ if config.files_to_run.one?
68
+ # Use the documentation formatter for detailed output,
69
+ # unless a formatter has already been configured
70
+ # (e.g. via a command-line flag).
71
+ config.default_formatter = 'doc'
72
+ end
73
+
74
+ # Print the 10 slowest examples and example groups at the
75
+ # end of the spec run, to help surface which specs are running
76
+ # particularly slow.
77
+ config.profile_examples = 10
78
+
79
+ # Run specs in random order to surface order dependencies. If you find an
80
+ # order dependency and want to debug it, you can fix the order by providing
81
+ # the seed, which is printed after each run.
82
+ # --seed 1234
83
+ config.order = :random
84
+
85
+ # Seed global randomization in this process using the `--seed` CLI option.
86
+ # Setting this allows you to use `--seed` to deterministically reproduce
87
+ # test failures related to randomization by passing the same `--seed` value
88
+ # as the one that triggered the failure.
89
+ Kernel.srand config.seed
90
+ =end
91
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-phpcachetool
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yuri Karamani
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: ''
42
+ email:
43
+ - y.karamani@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - .rspec
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - capistrano-phpcachetool.gemspec
55
+ - lib/capistrano/phpcachetool.rb
56
+ - lib/capistrano/phpcachetool/version.rb
57
+ - lib/capistrano/tasks/cachetool.rake
58
+ - spec/spec_helper.rb
59
+ homepage: ''
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.4.2
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Capistrano 3 plugin for work with php cache.
83
+ test_files:
84
+ - spec/spec_helper.rb