monkey_notification 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -32,12 +32,12 @@ PKG_FILES = FileList[
|
|
32
32
|
|
33
33
|
spec = Gem::Specification.new do |s|
|
34
34
|
s.name = "monkey_notification"
|
35
|
-
s.version = "0.0.
|
35
|
+
s.version = "0.0.7"
|
36
36
|
s.author = "Alexey Vasileiv"
|
37
37
|
s.email = "alexey.vasiliev@railsware.com"
|
38
38
|
s.homepage = "http://railsware.com/"
|
39
39
|
s.platform = Gem::Platform::RUBY
|
40
|
-
s.summary = "Monkey Notification
|
40
|
+
s.summary = "Monkey Notification"
|
41
41
|
s.description = "Railsware Monkey Notification Gem"
|
42
42
|
s.files = PKG_FILES.to_a
|
43
43
|
s.require_path = "lib"
|
@@ -7,17 +7,13 @@ class MonkeyNotificationGenerator < Rails::Generator::Base
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def manifest
|
10
|
-
if !api_url_configured? && !options[:api_url]
|
11
|
-
puts "Must pass --api-url or create config/initializers/monkey_notification.rb"
|
12
|
-
exit
|
13
|
-
end
|
14
10
|
record do |m|
|
15
11
|
m.directory 'lib/tasks'
|
16
12
|
m.file 'monkey_notification_tasks.rake', 'lib/tasks/monkey_notification_tasks.rake'
|
17
13
|
if ['config/deploy.rb', 'Capfile'].all? { |file| File.exists?(file) }
|
18
14
|
m.append_to 'config/deploy.rb', capistrano_hook
|
19
15
|
end
|
20
|
-
if
|
16
|
+
if options[:api_url] && !api_url_configured?
|
21
17
|
m.template 'initializer.rb', 'config/initializers/monkey_notification.rb',
|
22
18
|
:assigns => {:api_url => api_url_expression}
|
23
19
|
end
|
@@ -7,18 +7,14 @@ class MonkeyNotificationGenerator < Rails::Generators::Base
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def install
|
10
|
-
ensure_api_url_was_configured
|
11
10
|
append_capistrano_hook
|
12
|
-
generate_initializer
|
11
|
+
generate_initializer if api_url_need_configured?
|
13
12
|
end
|
14
13
|
|
15
14
|
private
|
16
15
|
|
17
|
-
def
|
18
|
-
|
19
|
-
puts "Must pass --api-url or create config/initializers/monkey_notification.rb"
|
20
|
-
exit
|
21
|
-
end
|
16
|
+
def api_url_need_configured?
|
17
|
+
options[:api_url] && api_url_configured?
|
22
18
|
end
|
23
19
|
|
24
20
|
def append_capistrano_hook
|
@@ -4,11 +4,6 @@ require 'active_support'
|
|
4
4
|
|
5
5
|
module MonkeyNotificationTasks
|
6
6
|
def self.deploy(opts = {})
|
7
|
-
if MonkeyNotification.configuration.api_url.blank?
|
8
|
-
puts "I don't seem to be configured with an Url. Please check your configuration."
|
9
|
-
return false
|
10
|
-
end
|
11
|
-
|
12
7
|
if opts[:rails_env].blank?
|
13
8
|
puts "I don't know to which Rails environment you are deploying (use the TO=production option)."
|
14
9
|
return false
|
@@ -19,7 +14,7 @@ module MonkeyNotificationTasks
|
|
19
14
|
params = {}
|
20
15
|
opts.each {|k,v| params["deploy[#{k}]"] = v }
|
21
16
|
|
22
|
-
url = URI.parse(api_url)
|
17
|
+
url = URI.parse(api_url || "http://monkey.railsware.com/api/v1/hook")
|
23
18
|
|
24
19
|
proxy = Net::HTTP.Proxy(MonkeyNotification.configuration.proxy_host,
|
25
20
|
MonkeyNotification.configuration.proxy_port,
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monkey_notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexey Vasileiv
|
@@ -92,6 +92,6 @@ rubyforge_project:
|
|
92
92
|
rubygems_version: 1.4.2
|
93
93
|
signing_key:
|
94
94
|
specification_version: 3
|
95
|
-
summary: Monkey Notification
|
95
|
+
summary: Monkey Notification
|
96
96
|
test_files: []
|
97
97
|
|