trello_flow 3.5.0 → 3.6.0

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: c3d4bb20f6148ce033a1ac325577ed284db1d552
4
- data.tar.gz: b6a1f3ce9cff0d7bb5a82b07a9b4b42cf2e9c0c3
3
+ metadata.gz: 7b1e9f30dd53f58947f5e50bf216210c5b9f2555
4
+ data.tar.gz: '069dea5960a81879b5e5016442a3e7b4f70a21b2'
5
5
  SHA512:
6
- metadata.gz: 903159fd5d6b4e06877bd32329370c4c98d8d474334df7c1a21f1e821cfc27cfadbf66b4bbd8c0dc302739cc94a045333cf6a51ecd1994798936cb1e24e0599f
7
- data.tar.gz: 03e22dd818e628f862b83ce89e5b10cbfe26fbc5477d62b7dfa67faf3726252f84ae32c694f3a205ecbdaa947574a5441383075cf1018017c6182c14752ff649
6
+ metadata.gz: b0aff2c51924533de3c06e002b8dd2119944b9819748b4f4786fffaf73659039d5c0c432105a75ceb528a7d5bf53584f403d3bf12e5d91d528f928eb4b4820c4
7
+ data.tar.gz: d89064d0602c7b949d4022362aa109eaeeb67472b7e1b57b502250f4d8657355d5baf944247225c5a3ac45a3d6523abc51c40413362f45675a26f0662e0575eb
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- before_install: gem install bundler -v 1.11.2
3
+ - 2.3.3
4
+ before_install: gem install bundler
@@ -1,5 +1,6 @@
1
1
  require "spyke"
2
2
  require "trello_flow/api/json_parser"
3
+ require "trello_flow/api/error_handler"
3
4
 
4
5
  module TrelloFlow
5
6
  module Api
@@ -15,9 +16,10 @@ module TrelloFlow
15
16
 
16
17
  def self.configure(key:, token:)
17
18
  self.connection = Faraday.new(url: "https://api.trello.com/1", params: { key: key, token: token }) do |c|
18
- c.request :json
19
- c.use JSONParser
20
- c.adapter Faraday.default_adapter
19
+ c.request :json
20
+ c.use JSONParser
21
+ c.use ErrorHandler
22
+ c.adapter Faraday.default_adapter
21
23
 
22
24
  # For trello api logging
23
25
  # require "faraday/conductivity"
@@ -0,0 +1,5 @@
1
+ module TrelloFlow
2
+ module Api
3
+ class Error < StandardError; end
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require "trello_flow/api/error"
2
+
3
+ module TrelloFlow
4
+ module Api
5
+ class ErrorHandler < Faraday::Middleware
6
+ def call(env)
7
+ @app.call(env).on_complete do
8
+ if !env.success?
9
+ raise Error, env[:body]
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -15,6 +15,8 @@ module TrelloFlow
15
15
  card.add_member(current_user)
16
16
  card.start
17
17
  Branch.from_card(user: current_user, card: card).checkout
18
+ rescue Api::Error => error
19
+ Cli.error(error.message)
18
20
  end
19
21
 
20
22
  def open
@@ -1,5 +1,5 @@
1
1
  module TrelloFlow
2
- VERSION = "3.5.0"
2
+ VERSION = "3.6.0"
3
3
  class Version
4
4
  def self.latest?
5
5
  new.latest?
@@ -12,11 +12,15 @@ module TrelloFlow
12
12
  private
13
13
 
14
14
  def latest_version
15
- @_latest_version ||= Gem.latest_version_for("trello_flow")
15
+ @_latest_version ||= Gem.latest_version_for("trello_flow") || first_version
16
16
  end
17
17
 
18
18
  def current_version
19
19
  @_current_version ||= Gem::Version.new(VERSION)
20
20
  end
21
+
22
+ def first_version
23
+ @_first_version ||= Gem::Version.new("1.0.0")
24
+ end
21
25
  end
22
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trello_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-14 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -274,6 +274,8 @@ files:
274
274
  - lib/trello_flow/api/base.rb
275
275
  - lib/trello_flow/api/board.rb
276
276
  - lib/trello_flow/api/card.rb
277
+ - lib/trello_flow/api/error.rb
278
+ - lib/trello_flow/api/error_handler.rb
277
279
  - lib/trello_flow/api/json_parser.rb
278
280
  - lib/trello_flow/api/label.rb
279
281
  - lib/trello_flow/api/list.rb