pivotal-github 1.0.5 → 1.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d27d159824834bb70a12f60c4b75a83592e25754
4
- data.tar.gz: e46e9dfe35a576e0aa13f1396bb3547312e9d4c9
3
+ metadata.gz: 091af9ded0530e42a30625af563e7dcebfcb97b6
4
+ data.tar.gz: caf99d0c43663d578bad073cc546aa16dcbf235a
5
5
  SHA512:
6
- metadata.gz: 2f008cd70d2b71cc0a21c688ad903cee873cdeb4986dcb6fb686a2beec1ad22bdc35a2d14466372b7f113e0274f12af30d10033d6d70f87b1070401ed7a45c91
7
- data.tar.gz: dd2649ccc19231dc16c7becd36185400b3edb544c120a95a8684ba24df07956658d3dd42105afb88060fec603e33c2a980a6370dcb76b6dc11b99f47307d9556
6
+ metadata.gz: 902f24ae87b0b379371a2e2110d87d8bd24573b3305856566419627e17026db3621b2a97958255bb4f31862beb2109a583b6e0930064e014f6fbbed59e76d7a7
7
+ data.tar.gz: bd03cd55db1985473f41226dcf59d78f7da727deae4f0e967bce299def4b89301d5a01a686f957068251badd455b0143f716eab0b0cfbe4969f36225cafff7b8
data/.gitignore CHANGED
@@ -17,5 +17,5 @@ test/version_tmp
17
17
  tmp
18
18
  .rvmrc
19
19
  .DS_Store
20
- .api_token
21
20
  .project_id
21
+ .api_token
@@ -70,6 +70,7 @@ class StoryAccept < Command
70
70
  else
71
71
  puts "Please create a file called '#{api_filename}'"
72
72
  puts "containing your Pivotal Tracker API token."
73
+ add_to_gitignore('.api_token')
73
74
  exit 1
74
75
  end
75
76
  end
@@ -81,10 +82,25 @@ class StoryAccept < Command
81
82
  else
82
83
  puts "Please create a file called '.project_id'"
83
84
  puts "containing the Pivotal Tracker project number."
85
+ add_to_gitignore('.project_id')
84
86
  exit 1
85
87
  end
86
88
  end
87
89
 
90
+ # Adds a filename to the .gitignore file (if necessary).
91
+ # This is put in as a security precaution, especially to keep the
92
+ # Pivotal Tracker API key from leaking.
93
+ def add_to_gitignore(filename)
94
+ gitignore = '.gitignore'
95
+ if File.exist?(gitignore)
96
+ contents = File.read(gitignore)
97
+ unless contents =~ /#{filename}/
98
+ File.open(gitignore, 'a') { |f| f.puts(filename) }
99
+ puts "Added #{filename} to .gitignore"
100
+ end
101
+ end
102
+ end
103
+
88
104
  # Changes a story's state to **Accepted**.
89
105
  def accept!(story_id)
90
106
  accepted = "<story><current_state>accepted</current_state></story>"
@@ -1,5 +1,5 @@
1
1
  module Pivotal
2
2
  module Github
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl