mina_notify 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11581a8f1597cf420415c1b0c98c5732f9978aa6
4
- data.tar.gz: 63c26219f3be9647598af8098f5c8502025ccf29
3
+ metadata.gz: 94f16b17fec96e12f411499dcb48b9f1c4010442
4
+ data.tar.gz: 1834917837b202793efae5a757b4aab8e9191117
5
5
  SHA512:
6
- metadata.gz: c5fb7570f1b6aef293584fc883f383a55789e4d747065282e6eb67466d50d3db960e3930e9bce42fa2a943bad00121e6c3dbd7f548d0a860a1afc83400595e50
7
- data.tar.gz: 61c1f8ea3e4bb25a3ea9365ddf806c4966fcd2d5c71c2cae3d19d85a010203a7ad3ef9316ed1c437c17d12ed6555296c26a054d3c72d07bf57a71d9465e21a8e
6
+ metadata.gz: b7ed5daab94c166f4afc81467558fb054eefc145b837369ca93b4a22d9af8a55a5e7dbc540e62044c0a0419fbe71121e31b301c4efeb2d4004a7c3232db1f14b
7
+ data.tar.gz: b36bd5e5a33eb81cb6b9a4313ae653990a0810a97ad61533cdc22347eee8c6fb9aafe0791751d63bf0d833c904459362e04fea30b7268bcd90c14f3b345bb65e
@@ -1,3 +1,3 @@
1
1
  module MinaNotify
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/mina_notify.rb CHANGED
@@ -1,10 +1,27 @@
1
1
  require "mina_notify/version"
2
2
  require 'mina'
3
+ require 'faraday'
3
4
 
4
5
  module MinaNotify
5
6
  module_function
6
7
 
7
8
  def trigger_event(mina_self, event_name)
8
- puts "mina_self:#{mina_self.domain},event_name:#{event_name},whoami:#{`whoami`}"
9
+ begin
10
+ mina = {
11
+ operator: `whoami`,
12
+ domain: mina_self.domain,
13
+ task_name: event_name,
14
+ code_src: mina_self.repository,
15
+ code_branch: mina_self.branch
16
+ }
17
+ response = Faraday.new(:url => 'http://dev.tanliani.com').post do |req|
18
+ req.url '/api/minas'
19
+ req.headers['Content-Type'] = 'application/json'
20
+ req.body = {mina: mina}.to_json
21
+ end
22
+ response.body
23
+ rescue Exception => e
24
+ end
25
+
9
26
  end
10
27
  end
data/mina_notify.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "rake", "~> 10.0"
34
34
  spec.add_development_dependency "mina", "~> 0.3.3"
35
35
  spec.add_development_dependency "rspec", "~> 3.2"
36
+ spec.add_development_dependency "faraday", "~> 0.9.1"
36
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina_notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: faraday
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.9.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.9.1
69
83
  description: mina deploy deploys
70
84
  email:
71
85
  - 15201280641@qq.com