capistrano-twitter 1.0.0

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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8e80bfe80a348428d6443b921e15e615d576b8de
4
+ data.tar.gz: e8fc8cdbe17dcf84c12ac9dd58e5b8110946c6ae
5
+ SHA512:
6
+ metadata.gz: 4aabe976de222809573367b036d1e52f0dff2cfa9e831a4026cb56e2e72589bd25fab72b214dca642d599e2d6b024807bb375d34643cbd9f48a036d558b5163b
7
+ data.tar.gz: 79307601e545326ffd94a71085c2296725111c22b0ad72672fc9ed3e4c882ffc729fbf4a8c2b2eb14f3388a84dc78e30896efa34e57e83b711f07f4fdd7a9770
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in capistrano-twitter.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,43 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-twitter (1.0.0)
5
+ colored (~> 1.2)
6
+ twitter (~> 5.14)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ addressable (2.3.7)
12
+ buftok (0.2.0)
13
+ colored (1.2)
14
+ equalizer (0.0.9)
15
+ faraday (0.9.1)
16
+ multipart-post (>= 1.2, < 3)
17
+ http (0.6.3)
18
+ http_parser.rb (~> 0.6.0)
19
+ http_parser.rb (0.6.0)
20
+ json (1.8.2)
21
+ memoizable (0.4.2)
22
+ thread_safe (~> 0.3, >= 0.3.1)
23
+ multipart-post (2.0.0)
24
+ naught (1.0.0)
25
+ simple_oauth (0.3.1)
26
+ thread_safe (0.3.4)
27
+ twitter (5.14.0)
28
+ addressable (~> 2.3)
29
+ buftok (~> 0.2.0)
30
+ equalizer (~> 0.0.9)
31
+ faraday (~> 0.9.0)
32
+ http (~> 0.6.0)
33
+ http_parser.rb (~> 0.6.0)
34
+ json (~> 1.8)
35
+ memoizable (~> 0.4.0)
36
+ naught (~> 1.0)
37
+ simple_oauth (~> 0.3.0)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ capistrano-twitter!
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 - 2011 Martin Jonsson
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # capistrano-twitter
2
+
3
+ Capistrano recipe to send a message to twitter
4
+
5
+ ## Installation
6
+
7
+ gem install capistrano-twitter
8
+
9
+ ## Usage
10
+
11
+ Include the recipe
12
+
13
+ require 'capistrano-twitter'
14
+
15
+ Set required parameters
16
+
17
+ set :twitter_consumer_key, "consumer key"
18
+ set :twitter_consumer_secret, "consumer secret"
19
+ set :twitter_access_token, "access token"
20
+ set :twitter_access_token_secret, "access token secret"
21
+ set :twitter_message, "MyApplication version {branch} has been deployed."
22
+
23
+ Add the task, e.g on after
24
+
25
+ after "twitter:notify"
@@ -0,0 +1,15 @@
1
+ # -*- encoding: utf-8 -*-
2
+ Gem::Specification.new do |s|
3
+ s.name = "capistrano-twitter"
4
+ s.version = "1.0.0"
5
+ s.authors = ["Martin Jonsson"]
6
+ s.email = ["martin.jonsson@gmail.com"]
7
+ s.homepage = "http://github.com/martinj/capistrano-twitter"
8
+ s.summary = "Capistrano recipe for twitter"
9
+ s.description = "Capistrano recipe to send message to twitter"
10
+ s.files = `git ls-files`.split("\n")
11
+ s.require_paths = ["lib"]
12
+ s.add_runtime_dependency 'colored', '~> 1.2'
13
+ s.add_runtime_dependency 'twitter', '~> 5.14'
14
+ s.license = 'MIT'
15
+ end
@@ -0,0 +1,35 @@
1
+ # encoding: utf-8
2
+ require 'capistrano'
3
+ require 'colored'
4
+ require 'twitter'
5
+
6
+ def _cset(name, *args, &block)
7
+ unless exists?(name)
8
+ set(name, *args, &block)
9
+ end
10
+ end
11
+
12
+ Capistrano::Configuratio@n.instance.load do
13
+ _cset(:twitter_consumer_key) { abort "Please specify twitter consumer key, set :twitter_consumer_key".red }
14
+ _cset(:twitter_consumer_secret) { abort "Please specify twitter consumer secret, set :twitter_consumer_secret".red }
15
+ _cset(:twitter_access_token) { abort "Please specify twitter access token, set :twitter_access_token".red }
16
+ _cset(:twitter_access_token_secret) { abort "Please specify twitter access token secret, set :twitter_access_token_secret".red }
17
+ _cset(:twitter_message) { abort "Please specify twitter notification message, set :twitter_message".red }
18
+
19
+ namespace :twitter do
20
+ desc "Send notification to twitter"
21
+ task :notify, :except => { :no_release => true } do
22
+ client = Twitter::REST::Client.new do |config|
23
+ config.consumer_key = twitter_consumer_key
24
+ config.consumer_secret = twitter_consumer_secret
25
+ config.access_token = twitter_access_token
26
+ config.access_token_secret = twitter_access_token_secret
27
+ end
28
+
29
+ if Capistrano::CLI.ui.ask("Send notification to twitter? (y/N)") == 'y' then
30
+ msg = twitter_message.gsub! '{branch}', branch
31
+ client.update(msg)
32
+ end
33
+ end
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-twitter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Martin Jonsson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colored
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: twitter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '5.14'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '5.14'
41
+ description: Capistrano recipe to send message to twitter
42
+ email:
43
+ - martin.jonsson@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - LICENSE
51
+ - README.md
52
+ - capistrano-twitter.gemspec
53
+ - lib/capistrano-twitter.rb
54
+ homepage: http://github.com/martinj/capistrano-twitter
55
+ licenses:
56
+ - MIT
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.0.14
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: Capistrano recipe for twitter
78
+ test_files: []