flowdock-rails 0.0.2 → 0.0.3
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/flowdock/rails.rb +23 -24
- data/lib/flowdock/rails/version.rb +1 -1
- metadata +13 -13
data/lib/flowdock/rails.rb
CHANGED
@@ -6,30 +6,6 @@ module Flowdock
|
|
6
6
|
module Rails
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
|
-
included do
|
10
|
-
def push_create_notification_to_flow
|
11
|
-
self.class.flow.push_to_team_inbox(
|
12
|
-
subject: "#{self.class.model_name.human} created",
|
13
|
-
content: %Q{
|
14
|
-
<h2>#{self.class.model_name.human} created</h2>
|
15
|
-
<pre>#{JSON.pretty_generate(self.attributes)}</pre>
|
16
|
-
},
|
17
|
-
tags: [self.class.model_name.param_key, "resource", "created"]
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
def push_update_notification_to_flow
|
22
|
-
self.class.flow.push_to_team_inbox(
|
23
|
-
subject: "#{self.class.model_name.human} updated",
|
24
|
-
content: %Q{
|
25
|
-
<h2>#{self.class.model_name.human} updated</h2>
|
26
|
-
<pre>#{JSON.pretty_generate(self.changes)}</pre>
|
27
|
-
},
|
28
|
-
tags: [self.class.model_name.param_key, "resource", "updated"]
|
29
|
-
)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
9
|
module ClassMethods
|
34
10
|
def flow
|
35
11
|
api_token = (ENV["FLOWDOCK_RAILS_API_TOKEN"].try(:split, ",") || []).map(&:strip)
|
@@ -56,6 +32,29 @@ module Flowdock
|
|
56
32
|
end
|
57
33
|
end
|
58
34
|
|
35
|
+
private
|
36
|
+
|
37
|
+
def push_create_notification_to_flow
|
38
|
+
self.class.flow.push_to_team_inbox(
|
39
|
+
subject: "#{self.class.model_name.human} created",
|
40
|
+
content: %Q{
|
41
|
+
<h2>#{self.class.model_name.human} created</h2>
|
42
|
+
<pre>#{JSON.pretty_generate(self.attributes)}</pre>
|
43
|
+
},
|
44
|
+
tags: [self.class.model_name.param_key, "resource", "created"]
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def push_update_notification_to_flow
|
49
|
+
self.class.flow.push_to_team_inbox(
|
50
|
+
subject: "#{self.class.model_name.human} updated",
|
51
|
+
content: %Q{
|
52
|
+
<h2>#{self.class.model_name.human} updated</h2>
|
53
|
+
<pre>#{JSON.pretty_generate(self.changes)}</pre>
|
54
|
+
},
|
55
|
+
tags: [self.class.model_name.param_key, "resource", "updated"]
|
56
|
+
)
|
57
|
+
end
|
59
58
|
end
|
60
59
|
end
|
61
60
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowdock-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2014-12-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70321797782420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70321797782420
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70321797781980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70321797781980
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: flowdock
|
38
|
-
requirement: &
|
38
|
+
requirement: &70321797781440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.5'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70321797781440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activerecord
|
49
|
-
requirement: &
|
49
|
+
requirement: &70321797780780 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>'
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70321797780780
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: activesupport
|
60
|
-
requirement: &
|
60
|
+
requirement: &70321797780320 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>'
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '3.0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70321797780320
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
|
-
requirement: &
|
71
|
+
requirement: &70321797779880 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70321797779880
|
80
80
|
description: Gem for notifying flows about the creation and updating of ActiveRecord
|
81
81
|
models.
|
82
82
|
email:
|