jenkins_tracker 0.2.1 → 0.3.0
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.
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/lib/jenkins_tracker/base.rb
CHANGED
@@ -8,7 +8,10 @@ module JenkinsTracker
|
|
8
8
|
raise FileNotFoundError, "Changelog file not found at: #{options[:changelog_file]}" unless File.file?(options[:changelog_file])
|
9
9
|
|
10
10
|
@changelog = File.read(options[:changelog_file])
|
11
|
+
|
11
12
|
@tracker_client = TrackerClient.new(:token => options[:tracker_token])
|
13
|
+
@tracker_client.use_ssl = true
|
14
|
+
|
12
15
|
@job_name = options[:job_name]
|
13
16
|
@build_url = options[:build_url]
|
14
17
|
end
|
@@ -13,7 +13,12 @@ module JenkinsTracker
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def add_note_to_story(project_id, story_id, note)
|
16
|
-
|
16
|
+
begin
|
17
|
+
connection["projects/#{project_id}/stories/#{story_id}/notes"].post("<note><text>#{note}</text></note>")
|
18
|
+
rescue => e
|
19
|
+
# if the post fails for whatever reason (e.g. invalid story id etc), just ignore it
|
20
|
+
puts ["An error occurred while trying add note to Story ##{story_id} in Project ##{project_id} ", e.message, e.backtrace] * "\n"
|
21
|
+
end
|
17
22
|
end
|
18
23
|
|
19
24
|
|
@@ -16,17 +16,20 @@ describe JenkinsTracker::Base do
|
|
16
16
|
expect(obj.build_url).to eq('http://jenkins.bitium/com/foo_job/3')
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'uses an SSL connection for the Tracker Client' do
|
20
|
+
obj = described_class.new(
|
21
|
+
:changelog_file => fixture_file_path('git_changelog.txt'),
|
22
|
+
:tracker_token => 'xxx'
|
23
|
+
)
|
24
|
+
expect(obj.tracker_client.connection.to_s).to start_with('https://')
|
25
|
+
end
|
26
|
+
|
19
27
|
context 'when changelog file does not exist' do
|
20
28
|
it 'raises a FileNotFoundError' do
|
21
29
|
changelog_file = '/a/non-existent/file/path'
|
22
30
|
|
23
31
|
expect {
|
24
|
-
described_class.new(
|
25
|
-
:changelog_file => changelog_file,
|
26
|
-
:tracker_token => 'xxx',
|
27
|
-
:job_name => 'foo_job',
|
28
|
-
:build_url => 'http://jenkins.bitium/com/foo_job/3'
|
29
|
-
)
|
32
|
+
described_class.new(:changelog_file => changelog_file)
|
30
33
|
}.to raise_error(JenkinsTracker::FileNotFoundError, "Changelog file not found at: #{changelog_file}")
|
31
34
|
end
|
32
35
|
end
|
@@ -8,6 +8,11 @@ describe JenkinsTracker::TrackerClient do
|
|
8
8
|
expect(tracker_client.connection).to be_an_instance_of(RestClient::Resource)
|
9
9
|
expect(tracker_client.connection.to_s).to eq('http://www.pivotaltracker.com/services/v3')
|
10
10
|
end
|
11
|
+
|
12
|
+
it 'does not use an SSL connection by default' do
|
13
|
+
tracker_client = described_class.new(:token => 'xxx')
|
14
|
+
expect(tracker_client.connection.to_s).to eq('http://www.pivotaltracker.com/services/v3')
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jenkins_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
segments:
|
122
122
|
- 0
|
123
|
-
hash: -
|
123
|
+
hash: -2227372096919744340
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
none: false
|
126
126
|
requirements:
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
segments:
|
131
131
|
- 0
|
132
|
-
hash: -
|
132
|
+
hash: -2227372096919744340
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
135
|
rubygems_version: 1.8.24
|