pivotal-to-trello 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: b07f7cf563cfd39dd77fea8ddea116c13442c800
4
- data.tar.gz: d1a9f8d00c58de04c1e46bdff752fd32d0c1f482
2
+ SHA256:
3
+ metadata.gz: c10f77ac27aa86a8d1aaf4c0db0418db55f53869184db93f60537703bfb489ec
4
+ data.tar.gz: 6dd95a122bbe59e8cade8a581bc99980e2ad6c73f09d6fc7bf50db2afa5dc0b3
5
5
  SHA512:
6
- metadata.gz: fe887375672d6a14d4c6ad9d534dd721f5ef1ee7c5d01702212ae05712eba40cbef054d9b3180fb5a2c42e543edc0ca09e9447d21dc3400410e041a1bf80e68e
7
- data.tar.gz: 2795928fd620bf9243634b596bfd360d358a554bc15b8f522ba8ea46fc6887e985267b216e19dcdcf549609ef76376efbb25a453b480f8f93be8e44bce00d998
6
+ metadata.gz: 03010c13de33774874cf4c91659e84d79aa1c7987476c329c638f68c002dafb8c4abaff33d1951203fdbb756bd0666b26ef586663b1de6bdabfc078a33abb4df
7
+ data.tar.gz: af73c66c3b40afe394846873ebc35bb76bf426991403a91c3423d94aeab234096961db6248f70a126ad91cfe88c923693c928c0f97d6993efc1b9454ded64b5b
data/.rubocop.yml CHANGED
@@ -1,102 +1,96 @@
1
1
  # See example at https://github.com/bbatsov/rubocop/blob/master/config/default.yml
2
+ require:
3
+ - rubocop-performance
4
+
2
5
  AllCops:
3
- TargetRubyVersion: 2.2
6
+ TargetRubyVersion: 2.6
4
7
  Exclude:
5
8
  - 'Gemfile'
6
9
  - 'pivotal-to-trello.gemspec'
7
10
 
8
- # Align the elements of a hash literal if they span more than one line.
9
- AlignHash:
10
- # Alignment of entries using hash rocket as separator. Valid values are:
11
- #
12
- # key - left alignment of keys
13
- # 'a' => 2
14
- # 'bb' => 3
15
- # separator - alignment of hash rockets, keys are right aligned
16
- # 'a' => 2
17
- # 'bb' => 3
18
- # table - left alignment of keys, hash rockets, and values
19
- # 'a' => 2
20
- # 'bb' => 3
11
+ Layout/EmptyLines:
12
+ Enabled: true
13
+
14
+ Layout/EmptyLinesAroundBlockBody:
15
+ Enabled: true
16
+
17
+ Layout/HashAlignment:
21
18
  EnforcedHashRocketStyle: table
22
- # Alignment of entries using colon as separator. Valid values are:
23
- #
24
- # key - left alignment of keys
25
- # a: 0
26
- # bb: 1
27
- # separator - alignment of colons, keys are right aligned
28
- # a: 0
29
- # bb: 1
30
- # table - left alignment of keys and values
31
- # a: 0
32
- # bb: 1
33
19
  EnforcedColonStyle: table
34
20
 
35
- Documentation:
36
- Enabled: false
21
+ Layout/LineLength:
22
+ Max: 200
37
23
 
38
- EmptyLines:
39
- Enabled: false
40
-
41
- Layout/EmptyLinesAroundBlockBody:
42
- Enabled: false
24
+ Layout/SpaceBeforeFirstArg:
25
+ Enabled: true
43
26
 
44
- LineLength:
45
- Max: 180
27
+ Layout/SpaceInsideParens:
28
+ Enabled: true
46
29
 
47
30
  Metrics/AbcSize:
48
31
  Enabled: true
49
- Max: 40
32
+ Max: 100
50
33
 
51
- Metrics/ClassLength:
34
+ Metrics/BlockLength:
52
35
  Enabled: false
53
36
  CountComments: false
54
37
 
55
- Metrics/BlockLength:
38
+ Metrics/CyclomaticComplexity:
39
+ Enabled: true
40
+ Max: 15
41
+
42
+ Metrics/ClassLength:
56
43
  Enabled: false
57
44
  CountComments: false
58
45
 
59
46
  Metrics/MethodLength:
60
47
  Enabled: true
61
48
  CountComments: false
62
- Max: 25
49
+ Max: 60
63
50
 
64
- ParameterLists:
65
- Max: 7
66
- CountKeywordArgs: true
51
+ Metrics/PerceivedComplexity:
52
+ Enabled: true
53
+ Max: 20
67
54
 
68
- SpaceInsideParens:
69
- Enabled: false
55
+ Naming/BlockParameterName:
56
+ MinNameLength: 1
70
57
 
71
- SpaceBeforeFirstArg:
58
+ Naming/FileName:
72
59
  Enabled: false
73
60
 
74
- Style/AndOr:
75
- Enabled: false
61
+ Naming/MethodParameterName:
62
+ MinNameLength: 1
76
63
 
77
- Style/BlockComments:
78
- Enabled: false
64
+ Style/AccessModifierDeclarations:
65
+ Enabled: true
66
+
67
+ Style/AndOr:
68
+ Enabled: true
79
69
 
80
70
  Style/BlockDelimiters:
81
- Enabled: false
71
+ Enabled: true
82
72
 
83
73
  Style/ClassAndModuleChildren:
84
74
  Enabled: true
85
75
  EnforcedStyle: nested
86
76
 
87
- Style/FrozenStringLiteralComment:
77
+ Style/Documentation:
88
78
  Enabled: false
89
79
 
80
+ Style/FrozenStringLiteralComment:
81
+ Enabled: true
82
+
90
83
  Style/RedundantReturn:
91
- Enabled: false
84
+ Enabled: true
92
85
 
93
86
  Style/TrailingCommaInArguments:
94
87
  Enabled: true
95
88
  EnforcedStyleForMultiline: comma
96
89
 
97
- Style/TrailingCommaInLiteral:
90
+ Style/TrailingCommaInArrayLiteral:
98
91
  Enabled: true
99
92
  EnforcedStyleForMultiline: comma
100
93
 
101
- Style/WordArray:
102
- Enabled: false
94
+ Style/TrailingCommaInHashLiteral:
95
+ Enabled: true
96
+ EnforcedStyleForMultiline: comma
data/Dockerfile CHANGED
@@ -1,16 +1,8 @@
1
- FROM ubuntu:14.04
1
+ FROM ruby:2.6
2
2
 
3
3
  MAINTAINER "Dave Perrett" https://github.com/Dockerfile
4
4
 
5
- # Dependencies
6
- RUN apt-get -y update &&\
7
- apt-get install -y software-properties-common &&\
8
- apt-add-repository ppa:brightbox/ruby-ng &&\
9
- apt-get update -q
10
-
11
- RUN apt-get install -y build-essential zlib1g-dev libxml2-dev \
12
- ruby2.2 ruby2.2-dev &&\
13
- gem install bundler --no-rdoc --no-ri
5
+ RUN gem install bundler
14
6
 
15
7
  # Prepare
16
8
  RUN mkdir /app
data/Gemfile CHANGED
@@ -1,12 +1,13 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
3
  gem 'highline', '~> 1.7.8'
4
- gem 'ruby-trello', '~> 2.0.0'
5
- gem 'pivotal-tracker', '~> 0.5.13'
4
+ gem 'ruby-trello', '~> 2.2.0'
5
+ gem 'tracker_api', '~> 1.10.0'
6
6
 
7
7
  group :development do
8
- gem 'rspec', '>= 2.14.1'
9
- gem 'rdoc', '>= 4.1.1'
10
- gem 'jeweler', '>= 2.3.7'
11
- gem 'rubocop', '>= 0.49.1'
8
+ gem 'rspec'
9
+ gem 'rdoc'
10
+ gem 'jeweler'
11
+ gem 'rubocop'
12
+ gem 'rubocop-performance'
12
13
  end
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- pivotal-to-trello [![Build Status](https://travis-ci.org/recurser/pivotal-to-trello.png?branch=master)](https://travis-ci.org/recurser/pivotal-to-trello)
1
+ pivotal-to-trello [![Build Status](https://travis-ci.org/recurser/pivotal-to-trello.png?branch=master)](https://travis-ci.org/recurser/pivotal-to-trello) [![Gem Version](https://badge.fury.io/rb/pivotal-to-trello.svg)](https://badge.fury.io/rb/pivotal-to-trello)
2
2
  =================
3
3
 
4
4
  This repo provides a command for exporting a [Pivotal Tracker](https://www.pivotaltracker.com/) project to [Trello](https://trello.com/). The command is available as a gem or a docker container.
@@ -12,9 +12,9 @@ Getting started
12
12
 
13
13
  Or pull the container down using Docker:
14
14
 
15
- > docker pull recurser/pivotal-to-trello
15
+ > docker pull ronawilliams/pivotal-to-trello
16
16
 
17
- When using the docker container, substitute every occurance of `pivotal-to-tracker` with `sudo docker run -a -i recurser/pivotal-to-tracker`
17
+ When using the docker container, substitute `pivotal-to-trello` with `docker run -i ronawilliams/pivotal-to-trello`
18
18
 
19
19
  2. Run the importer:
20
20
 
@@ -235,6 +235,7 @@ The Pivotal Tracker token can be found at the bottom of your [Pivotal profile pa
235
235
  Change history
236
236
  --------------
237
237
 
238
+ * **Version 0.3.0 (2019-12-04)** : Update to the maintained tracker_api gem (thanks @rwilliams!).
238
239
  * **Version 0.2.0 (2017-08-10)** : Fix label creation, update gem dependencies, add checklist support (thanks @rikthevik!), add docker support (thanks @kennethkalmer!).
239
240
  * **Version 0.1.2 (2014-01-13)** : Update version number in the gemspec.
240
241
  * **Version 0.1.1 (2014-01-13)** : Specify gem dependencies.
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'rubygems'
4
4
  require 'bundler'
5
5
  begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts 'Run `bundle install` to install missing gems'
8
+ warn e.message
9
+ warn 'Run `bundle install` to install missing gems'
10
10
  exit e.status_code
11
11
  end
12
12
  require 'rake'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  file = __FILE__
4
5
  if File.lstat(file).symlink?
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  unless defined? P2T_ROOT
2
- $LOAD_PATH << File.expand_path(File.dirname(__FILE__))
4
+ $LOAD_PATH << __dir__
3
5
  P2T_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
4
6
  P2T_LIB = File.join(P2T_ROOT, 'lib', 'pivotal_to_trello')
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'highline/import'
3
5
 
@@ -1,33 +1,31 @@
1
- require 'pivotal-tracker'
1
+ # frozen_string_literal: true
2
+
3
+ require 'tracker_api'
2
4
 
3
5
  module PivotalToTrello
4
6
  # Interface to the Pivotal Tracker API.
5
7
  class PivotalWrapper
6
8
  # Constructor
7
9
  def initialize(token)
8
- ::PivotalTracker::Client.token = token
9
- ::PivotalTracker::Client.use_ssl = true
10
+ @client = TrackerApi::Client.new(token: token)
10
11
  end
11
12
 
12
13
  # Returns a hash of available projects keyed on project ID.
13
14
  def project_choices
14
- ::PivotalTracker::Project.all.each_with_object({}) do |project, hash|
15
+ @client.projects.each_with_object({}) do |project, hash|
15
16
  hash[project.id] = project.name
16
-
17
17
  end
18
18
  end
19
19
 
20
20
  # Returns all stories for the given project.
21
21
  def stories(project_id)
22
- project(project_id).stories.all.sort_by(&:created_at)
22
+ @client.project(project_id).stories.sort_by(&:created_at)
23
23
  end
24
24
 
25
- private
26
-
27
25
  # Returns the Pivotal project that we're exporting.
28
26
  def project(project_id)
29
27
  @projects ||= {}
30
- @projects[project_id] ||= ::PivotalTracker::Project.find(project_id)
28
+ @projects[project_id] ||= @client.project(project_id)
31
29
  end
32
30
  end
33
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'optparse'
2
4
  require 'ostruct'
3
5
 
@@ -86,7 +88,7 @@ module PivotalToTrello
86
88
 
87
89
  global.order!
88
90
  command = args.shift
89
- commands[command].order! if commands[command]
91
+ commands[command]&.order!
90
92
 
91
93
  # Output a help message unless a command has been specified.
92
94
  STDOUT.write global unless options.action
@@ -104,5 +106,5 @@ module PivotalToTrello
104
106
  def show_version
105
107
  STDOUT.write "pivotal-to-trello version #{PivotalToTrello.version}"
106
108
  end
107
- end # class Runner
108
- end # module PivotalToTrello
109
+ end
110
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'trello'
2
4
 
3
5
  module PivotalToTrello
@@ -22,7 +24,7 @@ module PivotalToTrello
22
24
  list_id: list_id,
23
25
  )
24
26
 
25
- create_notes(card, pivotal_story)
27
+ create_comments(card, pivotal_story)
26
28
  create_tasks(card, pivotal_story)
27
29
  card
28
30
  end
@@ -48,7 +50,7 @@ module PivotalToTrello
48
50
  choices = Trello::Board.find(board_id).lists.each_with_object({}) do |list, hash|
49
51
  hash[list.id] = list.name
50
52
  end
51
- choices = Hash[choices.sort_by { |_, v| v }]
53
+ choices = Hash[choices.sort_by { |_, v| v }]
52
54
  choices[false] = "[don't import these stories]"
53
55
  choices
54
56
  end
@@ -92,15 +94,15 @@ module PivotalToTrello
92
94
  private
93
95
 
94
96
  # Copies notes from the pivotal story to the card.
95
- def create_notes(card, pivotal_story)
96
- pivotal_story.notes.all.each do |note|
97
- card.add_comment("[#{note.author}] #{note.text.to_s.strip}") unless note.text.to_s.strip.empty?
97
+ def create_comments(card, pivotal_story)
98
+ pivotal_story.comments.each do |comment|
99
+ card.add_comment(comment.text.to_s.strip.to_s) unless comment.text.to_s.strip.empty?
98
100
  end
99
101
  end
100
102
 
101
103
  # Copies notes from the pivotal story to the card.
102
104
  def create_tasks(card, pivotal_story)
103
- tasks = pivotal_story.tasks.all
105
+ tasks = pivotal_story.tasks
104
106
  return if tasks.empty?
105
107
 
106
108
  checklist = Trello::Checklist.create(name: 'Tasks', card_id: card.id)
@@ -2,19 +2,19 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pivotal-to-trello 0.2.0 ruby lib
5
+ # stub: pivotal-to-trello 0.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "pivotal-to-trello"
9
- s.version = "0.2.0"
8
+ s.name = "pivotal-to-trello".freeze
9
+ s.version = "0.3.0"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Dave Perrett", "Erik Frederiksen", "Kenneth Kalmer"]
14
- s.date = "2017-08-10"
15
- s.description = "Pulls stories from Pivotal Tracker and imports them into Trello"
16
- s.email = "hello@daveperrett.com"
17
- s.executables = ["pivotal-to-trello"]
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Dave Perrett".freeze, "Erik Frederiksen".freeze, "Kenneth Kalmer".freeze]
14
+ s.date = "2019-12-20"
15
+ s.description = "Pulls stories from Pivotal Tracker and imports them into Trello".freeze
16
+ s.email = "hello@daveperrett.com".freeze
17
+ s.executables = ["pivotal-to-trello".freeze]
18
18
  s.extra_rdoc_files = [
19
19
  "LICENSE.txt",
20
20
  "README.markdown"
@@ -40,39 +40,42 @@ Gem::Specification.new do |s|
40
40
  "spec/pivotal_to_trello/trello_wrapper_spec.rb",
41
41
  "spec/spec_helper.rb"
42
42
  ]
43
- s.homepage = "http://github.com/recurser/pivotal-to-trello"
44
- s.licenses = ["MIT"]
45
- s.rubygems_version = "2.4.5"
46
- s.summary = "Pivotal Tracker to Trello exporter"
43
+ s.homepage = "http://github.com/recurser/pivotal-to-trello".freeze
44
+ s.licenses = ["MIT".freeze]
45
+ s.rubygems_version = "3.0.3".freeze
46
+ s.summary = "Pivotal Tracker to Trello exporter".freeze
47
47
 
48
48
  if s.respond_to? :specification_version then
49
49
  s.specification_version = 4
50
50
 
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_runtime_dependency(%q<highline>, ["~> 1.7.8"])
53
- s.add_runtime_dependency(%q<ruby-trello>, ["~> 2.0.0"])
54
- s.add_runtime_dependency(%q<pivotal-tracker>, ["~> 0.5.13"])
55
- s.add_development_dependency(%q<rspec>, [">= 2.14.1"])
56
- s.add_development_dependency(%q<rdoc>, [">= 4.1.1"])
57
- s.add_development_dependency(%q<jeweler>, [">= 2.3.7"])
58
- s.add_development_dependency(%q<rubocop>, [">= 0.49.1"])
52
+ s.add_runtime_dependency(%q<highline>.freeze, ["~> 1.7.8"])
53
+ s.add_runtime_dependency(%q<ruby-trello>.freeze, ["~> 2.2.0"])
54
+ s.add_runtime_dependency(%q<tracker_api>.freeze, ["~> 1.10.0"])
55
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
56
+ s.add_development_dependency(%q<rdoc>.freeze, [">= 0"])
57
+ s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
58
+ s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
59
+ s.add_development_dependency(%q<rubocop-performance>.freeze, [">= 0"])
59
60
  else
60
- s.add_dependency(%q<highline>, ["~> 1.7.8"])
61
- s.add_dependency(%q<ruby-trello>, ["~> 2.0.0"])
62
- s.add_dependency(%q<pivotal-tracker>, ["~> 0.5.13"])
63
- s.add_dependency(%q<rspec>, [">= 2.14.1"])
64
- s.add_dependency(%q<rdoc>, [">= 4.1.1"])
65
- s.add_dependency(%q<jeweler>, [">= 2.3.7"])
66
- s.add_dependency(%q<rubocop>, [">= 0.49.1"])
61
+ s.add_dependency(%q<highline>.freeze, ["~> 1.7.8"])
62
+ s.add_dependency(%q<ruby-trello>.freeze, ["~> 2.2.0"])
63
+ s.add_dependency(%q<tracker_api>.freeze, ["~> 1.10.0"])
64
+ s.add_dependency(%q<rspec>.freeze, [">= 0"])
65
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
66
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
67
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
68
+ s.add_dependency(%q<rubocop-performance>.freeze, [">= 0"])
67
69
  end
68
70
  else
69
- s.add_dependency(%q<highline>, ["~> 1.7.8"])
70
- s.add_dependency(%q<ruby-trello>, ["~> 2.0.0"])
71
- s.add_dependency(%q<pivotal-tracker>, ["~> 0.5.13"])
72
- s.add_dependency(%q<rspec>, [">= 2.14.1"])
73
- s.add_dependency(%q<rdoc>, [">= 4.1.1"])
74
- s.add_dependency(%q<jeweler>, [">= 2.3.7"])
75
- s.add_dependency(%q<rubocop>, [">= 0.49.1"])
71
+ s.add_dependency(%q<highline>.freeze, ["~> 1.7.8"])
72
+ s.add_dependency(%q<ruby-trello>.freeze, ["~> 2.2.0"])
73
+ s.add_dependency(%q<tracker_api>.freeze, ["~> 1.10.0"])
74
+ s.add_dependency(%q<rspec>.freeze, [">= 0"])
75
+ s.add_dependency(%q<rdoc>.freeze, [">= 0"])
76
+ s.add_dependency(%q<jeweler>.freeze, [">= 0"])
77
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
78
+ s.add_dependency(%q<rubocop-performance>.freeze, [">= 0"])
76
79
  end
77
80
  end
78
81
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path(File.dirname(File.dirname(__FILE__)) + '/spec_helper')
2
4
 
3
5
  describe 'Core' do
@@ -1,32 +1,31 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path(File.dirname(File.dirname(__FILE__)) + '/spec_helper')
2
4
 
3
5
  describe 'PivotalWrapper' do
4
- let(:wrapper) { PivotalToTrello::PivotalWrapper.new('token') }
6
+ # API Token is for a user with just one public sample project.
7
+ let(:token) { 'ab4c5895f57995bb7547986eacf91160' }
8
+ let(:wrapper) { PivotalToTrello::PivotalWrapper.new(token) }
5
9
 
6
10
  context '#initialize' do
7
11
  it 'sets the pivotal token' do
8
- expect(::PivotalTracker::Client).to receive(:token=).with('token')
9
- PivotalToTrello::PivotalWrapper.new('token')
12
+ expect(TrackerApi::Client).to receive(:new).with(token: token)
13
+ PivotalToTrello::PivotalWrapper.new(token)
10
14
  end
11
15
  end
12
16
 
13
17
  context '#project_choices' do
14
18
  it 'returns a hash of pivotal projects' do
15
- project = OpenStruct.new(id: 'id', name: 'My Project')
16
- expect(::PivotalTracker::Project).to receive(:all).and_return([project])
17
- expect(wrapper.project_choices).to eq('id' => 'My Project')
19
+ expect(wrapper.project_choices).to eq(1_027_488 => 'My Sample Project', 1_027_492 => 'My Sample Project')
18
20
  end
19
21
  end
20
22
 
21
23
  context '#stories' do
22
24
  it 'returns a sorted array of pivotal stories' do
23
- first_story = mock_pivotal_story(created_at: Time.now - 10_000)
24
- last_story = mock_pivotal_story(created_at: Time.now + 10_000)
25
- project = double(PivotalTracker::Project)
26
- expect(::PivotalTracker::Project).to receive(:find).with('project_id').and_return(project)
27
- allow(project).to receive_message_chain(:stories, :all).and_return([last_story, first_story])
28
- expect(wrapper.stories('project_id').first).to eq(first_story)
29
- expect(wrapper.stories('project_id').last).to eq(last_story)
25
+ expect(wrapper.project(1_027_488).id).to eq 1_027_488
26
+ expect(wrapper.project(1_027_488).stories.count).to eq 85
27
+ expect(wrapper.project(1_027_488).stories.first.id).to eq(66_727_974)
28
+ expect(wrapper.project(1_027_488).stories.last.id).to eq(66_728_090)
30
29
  end
31
30
  end
32
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path(File.dirname(File.dirname(__FILE__)) + '/spec_helper')
2
4
 
3
5
  describe 'TrelloWrapper' do
@@ -50,12 +52,12 @@ describe 'TrelloWrapper' do
50
52
  end
51
53
 
52
54
  it 'adds comments' do
53
- note = OpenStruct.new(text: 'My Note', author: 'John Smith')
55
+ note = OpenStruct.new(text: 'My Note')
54
56
  story = mock_pivotal_story
55
- allow(story).to receive_message_chain(:notes, :all).and_return([note])
57
+ allow(story).to receive(:comments).and_return([note])
56
58
  expect(wrapper).to receive(:get_card).and_return(nil)
57
59
  expect(Trello::Card).to receive(:create).and_return(card)
58
- expect(card).to receive(:add_comment).with('[John Smith] My Note')
60
+ expect(card).to receive(:add_comment).with('My Note')
59
61
  expect(wrapper.create_card('list_id', story)).to eq(card)
60
62
  end
61
63
 
@@ -63,7 +65,7 @@ describe 'TrelloWrapper' do
63
65
  task = OpenStruct.new(description: 'My Task', complete: false)
64
66
  story = mock_pivotal_story
65
67
  checklist = double(Trello::Checklist)
66
- allow(story).to receive_message_chain(:tasks, :all).and_return([task])
68
+ allow(story).to receive(:tasks).and_return([task])
67
69
  expect(wrapper).to receive(:get_card).and_return(nil)
68
70
  expect(Trello::Card).to receive(:create).and_return(card)
69
71
  expect(Trello::Checklist).to receive(:create).with(name: 'Tasks', card_id: card.id).and_return(checklist)
@@ -87,8 +89,8 @@ describe 'TrelloWrapper' do
87
89
  list = OpenStruct.new(id: 'id', name: 'My List')
88
90
  expect(Trello::Board).to receive(:find).with('board_id').and_return(board)
89
91
  expect(board).to receive(:lists).and_return([list])
90
- expect(wrapper.list_choices('board_id')).to eq( 'id' => 'My List',
91
- false => "[don't import these stories]")
92
+ expect(wrapper.list_choices('board_id')).to eq('id' => 'My List',
93
+ false => "[don't import these stories]")
92
94
  end
93
95
  end
94
96
 
@@ -132,5 +134,4 @@ describe 'TrelloWrapper' do
132
134
  wrapper.add_label(card, 'bug', 'red')
133
135
  end
134
136
  end
135
-
136
137
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
5
  require 'rspec'
@@ -5,7 +7,7 @@ require 'pivotal-to-trello'
5
7
 
6
8
  # Requires supporting files with custom matchers and macros, etc,
7
9
  # in ./support/ and its subdirectories.
8
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
9
11
 
10
12
  RSpec.configure do |config|
11
13
  end
@@ -32,9 +34,10 @@ def mock_pivotal_story(options = {})
32
34
  current_state: 'unstarted',
33
35
  story_type: 'feature',
34
36
  }.merge(options)
35
- story = double(PivotalTracker::Story)
36
- allow(story).to receive_message_chain(:notes, :all).and_return([])
37
- allow(story).to receive_message_chain(:tasks, :all).and_return([])
37
+
38
+ story = double(TrackerApi::Resources::Story)
39
+ allow(story).to receive(:comments).and_return([])
40
+ allow(story).to receive(:tasks).and_return([])
38
41
  options.each { |k, v| allow(story).to receive_messages(k => v) }
39
42
  story
40
43
  end
@@ -52,20 +55,20 @@ def mock_trello_card(options = {})
52
55
  end
53
56
 
54
57
  def mock_options
55
- OpenStruct.new( pivotal_project_id: 'pivotal_project_id',
56
- trello_board_id: 'trello_board_id',
57
- icebox_list_id: 'icebox_list_id',
58
- current_list_id: 'current_list_id',
59
- finished_list_id: 'finished_list_id',
60
- delivered_list_id: 'delivered_list_id',
61
- accepted_list_id: 'accepted_list_id',
62
- rejected_list_id: 'rejected_list_id',
63
- bug_list_id: 'bug_list_id',
64
- chore_list_id: 'chore_list_id',
65
- feature_list_id: 'feature_list_id',
66
- release_list_id: 'release_list_id',
67
- bug_label: 'bug_label',
68
- feature_label: 'feature_label',
69
- chore_label: 'chore_label',
70
- release_label: 'release_label')
58
+ OpenStruct.new(pivotal_project_id: 'pivotal_project_id',
59
+ trello_board_id: 'trello_board_id',
60
+ icebox_list_id: 'icebox_list_id',
61
+ current_list_id: 'current_list_id',
62
+ finished_list_id: 'finished_list_id',
63
+ delivered_list_id: 'delivered_list_id',
64
+ accepted_list_id: 'accepted_list_id',
65
+ rejected_list_id: 'rejected_list_id',
66
+ bug_list_id: 'bug_list_id',
67
+ chore_list_id: 'chore_list_id',
68
+ feature_list_id: 'feature_list_id',
69
+ release_list_id: 'release_list_id',
70
+ bug_label: 'bug_label',
71
+ feature_label: 'feature_label',
72
+ chore_label: 'chore_label',
73
+ release_label: 'release_label')
71
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-to-trello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Perrett
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-08-10 00:00:00.000000000 Z
13
+ date: 2019-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -32,84 +32,98 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 2.0.0
35
+ version: 2.2.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 2.0.0
42
+ version: 2.2.0
43
43
  - !ruby/object:Gem::Dependency
44
- name: pivotal-tracker
44
+ name: tracker_api
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 0.5.13
49
+ version: 1.10.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 0.5.13
56
+ version: 1.10.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rspec
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 2.14.1
63
+ version: '0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 2.14.1
70
+ version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rdoc
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: 4.1.1
77
+ version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: 4.1.1
84
+ version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: jeweler
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
- version: 2.3.7
91
+ version: '0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
- version: 2.3.7
98
+ version: '0'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: rubocop
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - ">="
104
104
  - !ruby/object:Gem::Version
105
- version: 0.49.1
105
+ version: '0'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 0.49.1
112
+ version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: rubocop-performance
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
113
127
  description: Pulls stories from Pivotal Tracker and imports them into Trello
114
128
  email: hello@daveperrett.com
115
129
  executables:
@@ -157,8 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
171
  - !ruby/object:Gem::Version
158
172
  version: '0'
159
173
  requirements: []
160
- rubyforge_project:
161
- rubygems_version: 2.4.5
174
+ rubygems_version: 3.0.3
162
175
  signing_key:
163
176
  specification_version: 4
164
177
  summary: Pivotal Tracker to Trello exporter