pivotal_to_pdf 1.4.0 → 1.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: b176423fcc0af29ac5d913e5c2a0650ad9714b4a
4
- data.tar.gz: e34062d44ac26277f8e5d439a2723e3b64cf0203
3
+ metadata.gz: a6caf22afb13aa574eb898a97ef80755c7e1cc41
4
+ data.tar.gz: f40a1ab5815e1e761f667f8e005a3af818e90260
5
5
  SHA512:
6
- metadata.gz: 2ee28e02bbefd0bad1f8cd0fdb76528e5daf2298833e028a2d0547bc9ffc4688bd0b79a478a2356e3bfbea6ad9288b4c42eb2ce1571492b992f39f6ad53ba0bc
7
- data.tar.gz: ee1c69c27f6ff9516cef249a5e965d08fbd3ac41680b31f32812fc02c4a63d5929e9a549dc3811af36806497ca4118625e0631b68389ba4be1407e8321c69cd0
6
+ metadata.gz: 354041aab0146c5e24e1632734f8b22043b60a96e1080de600692133eb090f22f28cca061f5d3403b039a344447476775690ae13b6b160dcad0a2a1dec6e43ac
7
+ data.tar.gz: f94f9255f790ea702e9ce6092c35e0f42d818cfc4b33745af28de35faef92b5ffc5faad2c5eb053c1eaf7b922819fa2a56fce1274d1a4bc2d35f6cdf96fcf186
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p451
1
+ 2.2.2
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
- script: "cp .pivotal.yml.sample .pivotal.yml; PIVOTAL_TO_PDF_CONFIG_DIR=. bundle exec rake spec"
1
+ script: "cp .pivotal.yml.sample .pivotal.yml; PIVOTAL_TO_PDF_CONFIG_DIR=. bundle exec rspec"
2
2
  rvm:
3
- - 1.9.3
3
+ - 2.2.2
data/Gemfile CHANGED
@@ -1,14 +1,10 @@
1
1
  source 'http://rubygems.org'
2
- gem 'rainbow'
3
2
  gem 'activeresource', "3.0.9"
4
3
  gem 'prawn'
5
4
  gem 'thor'
6
5
  gem "pivotal_to_pdf-formatters", ">=0.0.4"
7
6
  group :test do
8
7
  gem 'rspec'
9
- gem "guard-spork"
10
- gem "guard-rspec"
11
- gem "growl-rspec"
12
8
  end
13
9
 
14
10
  group :test, :development do
data/Gemfile.lock CHANGED
@@ -1,7 +1,6 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- Ascii85 (1.0.1)
5
4
  activemodel (3.0.9)
6
5
  activesupport (= 3.0.9)
7
6
  builder (~> 2.1.2)
@@ -11,54 +10,39 @@ GEM
11
10
  activesupport (= 3.0.9)
12
11
  activesupport (3.0.9)
13
12
  builder (2.1.2)
14
- diff-lcs (1.1.3)
15
- ffi (1.0.11)
16
- growl (1.0.3)
17
- growl-rspec (0.0.1)
18
- growl
19
- rspec
20
- guard (1.0.1)
21
- ffi (>= 0.5.0)
22
- thor (~> 0.14.6)
23
- guard-rspec (0.7.0)
24
- guard (>= 0.10.0)
25
- guard-spork (0.6.1)
26
- guard (>= 0.10.0)
27
- spork (>= 0.8.4)
28
- i18n (0.5.0)
29
- pdf-reader (1.1.1)
30
- Ascii85 (~> 1.0.0)
31
- ruby-rc4
32
- pivotal_to_pdf-formatters (0.0.4)
33
- prawn (0.12.0)
34
- pdf-reader (>= 0.9.0)
35
- ttfunk (~> 1.0.2)
13
+ diff-lcs (1.2.5)
14
+ i18n (0.5.4)
15
+ pdf-core (0.5.1)
16
+ pivotal_to_pdf-formatters (0.2.1)
17
+ rainbow
18
+ prawn (2.0.1)
19
+ pdf-core (~> 0.5.1)
20
+ ttfunk (~> 1.4.0)
36
21
  rainbow (2.0.0)
37
- rake (0.9.2.2)
38
- rspec (2.11.0)
39
- rspec-core (~> 2.11.0)
40
- rspec-expectations (~> 2.11.0)
41
- rspec-mocks (~> 2.11.0)
42
- rspec-core (2.11.0)
43
- rspec-expectations (2.11.1)
44
- diff-lcs (~> 1.1.3)
45
- rspec-mocks (2.11.1)
46
- ruby-rc4 (0.1.5)
47
- spork (0.9.0)
48
- thor (0.14.6)
49
- ttfunk (1.0.3)
22
+ rake (10.4.2)
23
+ rspec (3.2.0)
24
+ rspec-core (~> 3.2.0)
25
+ rspec-expectations (~> 3.2.0)
26
+ rspec-mocks (~> 3.2.0)
27
+ rspec-core (3.2.3)
28
+ rspec-support (~> 3.2.0)
29
+ rspec-expectations (3.2.1)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.2.0)
32
+ rspec-mocks (3.2.1)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.2.0)
35
+ rspec-support (3.2.2)
36
+ thor (0.19.1)
37
+ ttfunk (1.4.0)
50
38
 
51
39
  PLATFORMS
52
40
  ruby
53
41
 
54
42
  DEPENDENCIES
55
43
  activeresource (= 3.0.9)
56
- growl-rspec
57
- guard-rspec
58
- guard-spork
59
44
  pivotal_to_pdf-formatters (>= 0.0.4)
60
45
  prawn
61
- rainbow
62
46
  rake
63
47
  rspec
64
48
  thor
data/README.md CHANGED
@@ -29,7 +29,7 @@ After install the gem, you can do:
29
29
 
30
30
  * pivotal_to_pdf current_iteration # print stories for the current iteration into a PDF file
31
31
 
32
- * pivotal_to_pdf story STORY_ID # print a single story specifed by ID into a PDF file
32
+ * pivotal_to_pdf story STORY_ID, additional_story_ids # print stories specifed by IDs into a PDF file
33
33
 
34
34
  * pivotal_to_pdf iteration ITERATION_NUMBER # print a single iteration specifed by the number into a PDF file
35
35
 
@@ -41,6 +41,8 @@ Examples:
41
41
 
42
42
  pivotal_to_pdf story 159898
43
43
 
44
+ pivotal_to_pdf story 159898, 159987
45
+
44
46
  pivotal_to_pdf current_iteration
45
47
 
46
48
  pivotal_to_pdf iteration 42
@@ -96,3 +98,4 @@ to use the new formatters being added
96
98
  * [John-Mason P. Shackelford](https://github.com/jpshackelford)
97
99
  * [Bret Mogilefsky](https://github.com/mogul)
98
100
  * [Luke brown](https://github.com/tsdbrown)
101
+ * [Scott Speidel](https://github.com/scottspeidel)
data/bin/pivotal_to_pdf CHANGED
@@ -4,9 +4,11 @@ require 'pivotal_to_pdf'
4
4
  require 'thor'
5
5
 
6
6
  class PivotalToPdfApp < Thor
7
- desc "story STORY_ID", "print a single story specifed by ID into a PDF file. The card will have a color stripe. The color will be green for features, yellow for chores and red for bugs"
8
- def story(story_id)
9
- PivotalToPdf::Main.story story_id
7
+
8
+ desc "story [STORY_IDs]", "print one or more stories specifed by ID into a PDF file. The card will have a color stripe. The color will be green for features, yellow for chores and red for bugs"
9
+ def story(story_id, *other_story_ids)
10
+ story_ids = (other_story_ids || []).unshift(story_id)
11
+ PivotalToPdf::Main.story story_ids
10
12
  end
11
13
 
12
14
  desc "current_iteration", "print stories for the current iteration into a PDF file"
@@ -16,9 +16,9 @@ require 'pivotal_to_pdf/pt-workarounds'
16
16
  module PivotalToPdf
17
17
  class Main < Thor
18
18
  class << self
19
- def story(story_id)
20
- story = Story.find(story_id)
21
- FormatterFactory.formatter.new([ story ]).write_to(story_id)
19
+ def story(story_ids)
20
+ stories = Story.find_stories(story_ids)
21
+ FormatterFactory.formatter.new(stories).write_to("stories")
22
22
  end
23
23
 
24
24
  def current_iteration
@@ -1,5 +1,14 @@
1
1
  module PivotalToPdf
2
2
  class Story < Pivotal
3
+
4
+ def self.find_stories(story_ids)
5
+ stories = []
6
+ story_ids.each do |id|
7
+ stories << self.find(id)
8
+ end
9
+ stories
10
+ end
11
+
3
12
  def formatted_labels
4
13
  return "" if !self.respond_to?(:labels) || self.labels.nil? || self.labels.empty?
5
14
  formatted_output :labels
@@ -1,3 +1,3 @@
1
1
  module PivotalToPdf
2
- VERSION = "1.4.0"
2
+ VERSION = "1.6.0"
3
3
  end
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.add_runtime_dependency(%q<pivotal_to_pdf-formatters>, ">= 0.0.4")
20
20
  s.add_runtime_dependency(%q<activeresource>, "3.0.9")
21
21
  s.add_runtime_dependency(%q<prawn>, "0.12.0")
22
- s.add_runtime_dependency(%q<rainbow>, ">= 2.0")
23
22
  s.add_runtime_dependency(%q<thor>, ">= 0")
24
23
  s.add_development_dependency(%q<rspec>)
25
24
  s.homepage = "https://github.com/ywen/pivotal_to_pdf"
@@ -3,8 +3,12 @@ load File.expand_path(File.join(File.dirname(__FILE__), "..", "bin", "pivotal_to
3
3
 
4
4
  describe 'PivotalToPdf Bin' do
5
5
  context "when passed in story sub command" do
6
- it "should call story" do
7
- PivotalToPdf::Main.should_receive(:story).with(123)
6
+ it "should call story with more than one id" do
7
+ PivotalToPdf::Main.should_receive(:story).with([123,234,345])
8
+ PivotalToPdfApp.start(["story", 123, 234, 345])
9
+ end
10
+ it "should call story with one id" do
11
+ PivotalToPdf::Main.should_receive(:story).with([123])
8
12
  PivotalToPdfApp.start(["story", 123])
9
13
  end
10
14
  it "should not call story when no story id is given" do
@@ -15,27 +15,32 @@ module PivotalToPdf
15
15
  end
16
16
  describe ".story" do
17
17
  let(:story) {double :story}
18
- let(:method) { lambda{ Main.story 32 } }
18
+ let(:method) { lambda{ Main.story([23]) } }
19
19
  before(:each) do
20
- Story.stub(:find).and_return story
20
+ Story.stub(:find_stories).and_return story
21
21
  Formatters::Default.stub(:new).and_return writer
22
22
  end
23
23
 
24
24
  include_examples "formatter fetching"
25
-
25
+
26
26
  it "initiates a story" do
27
- Story.should_receive(:find).with(23).and_return story
28
- Main.story 23
27
+ Story.should_receive(:find_stories).with([23]).and_return story
28
+ Main.story([23])
29
+ end
30
+
31
+ it "initiates two stories" do
32
+ Story.should_receive(:find_stories).with([23, 55]).and_return story
33
+ Main.story([23, 55])
29
34
  end
30
35
 
31
36
  it "build a pdf writer" do
32
- Formatters::Default.should_receive(:new).with([ story ]).and_return writer
33
- Main.story 23
37
+ Formatters::Default.should_receive(:new).with(story).and_return writer
38
+ Main.story([23])
34
39
  end
35
40
 
36
41
  it "asks the pdf writer to print it" do
37
42
  writer.should_receive :write_to
38
- Main.story 23
43
+ Main.story([23])
39
44
  end
40
45
  end
41
46
  describe ".current_iteration" do
data/spec/spec_helper.rb CHANGED
@@ -1,22 +1,13 @@
1
1
  require 'rubygems'
2
- require 'spork'
3
2
  require 'rspec/core'
4
3
 
5
- Spork.prefork do
6
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
7
- RSpec.configure do |config|
8
- config.expect_with :rspec do |c|
9
- c.syntax = :expect
10
- end
11
- config.mock_with :rspec
12
- config.extend Macros
4
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
5
+ RSpec.configure do |config|
6
+ config.expect_with :rspec do |c|
7
+ c.syntax = :expect
13
8
  end
14
-
15
- end
16
-
17
- Spork.each_run do
18
- # Requires supporting files with custom matchers and macros, etc,
19
- # in ./support/ and its subdirectories.
20
- require "#{File.dirname(__FILE__)}/../lib/pivotal_to_pdf"
21
- Dir["#{File.dirname(__FILE__)}/../lib/**/*.rb"].each {|f| require f}
9
+ config.mock_with :rspec
10
+ config.extend Macros
22
11
  end
12
+ require "#{File.dirname(__FILE__)}/../lib/pivotal_to_pdf"
13
+ Dir["#{File.dirname(__FILE__)}/../lib/**/*.rb"].each {|f| require f}
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal_to_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yi Wen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2015-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pivotal_to_pdf-formatters
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.4
27
27
  - !ruby/object:Gem::Dependency
@@ -52,46 +52,32 @@ dependencies:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.12.0
55
- - !ruby/object:Gem::Dependency
56
- name: rainbow
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '2.0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '2.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: thor
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: '0'
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  description: Convert Pivotal Tracker Stories to 4x6 PDF for printing so that you can
@@ -103,13 +89,13 @@ executables:
103
89
  extensions: []
104
90
  extra_rdoc_files: []
105
91
  files:
106
- - .bundle/config
107
- - .gitignore
108
- - .pivotal.yml.sample
109
- - .rspec
110
- - .ruby-version
111
- - .rvmrc
112
- - .travis.yml
92
+ - ".bundle/config"
93
+ - ".gitignore"
94
+ - ".pivotal.yml.sample"
95
+ - ".rspec"
96
+ - ".ruby-version"
97
+ - ".rvmrc"
98
+ - ".travis.yml"
113
99
  - CHANGELOG.md
114
100
  - Gemfile
115
101
  - Gemfile.lock
@@ -149,17 +135,17 @@ require_paths:
149
135
  - lib
150
136
  required_ruby_version: !ruby/object:Gem::Requirement
151
137
  requirements:
152
- - - '>='
138
+ - - ">="
153
139
  - !ruby/object:Gem::Version
154
140
  version: '0'
155
141
  required_rubygems_version: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - '>='
143
+ - - ">="
158
144
  - !ruby/object:Gem::Version
159
145
  version: '0'
160
146
  requirements: []
161
147
  rubyforge_project:
162
- rubygems_version: 2.2.2
148
+ rubygems_version: 2.4.5
163
149
  signing_key:
164
150
  specification_version: 4
165
151
  summary: Convert Pivotal Tracker Stories to 4x6 PDF cards