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 +4 -4
- data/.gitignore +1 -1
- data/lib/pivotal-github/story_accept.rb +16 -0
- data/lib/pivotal-github/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 091af9ded0530e42a30625af563e7dcebfcb97b6
|
4
|
+
data.tar.gz: caf99d0c43663d578bad073cc546aa16dcbf235a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 902f24ae87b0b379371a2e2110d87d8bd24573b3305856566419627e17026db3621b2a97958255bb4f31862beb2109a583b6e0930064e014f6fbbed59e76d7a7
|
7
|
+
data.tar.gz: bd03cd55db1985473f41226dcf59d78f7da727deae4f0e967bce299def4b89301d5a01a686f957068251badd455b0143f716eab0b0cfbe4969f36225cafff7b8
|
data/.gitignore
CHANGED
@@ -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>"
|