JiraClient 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 65df80baf451cd9f5a1a25c9f6b5b462c5e4d1ec
4
+ data.tar.gz: d15c085e144a6f6fa5907b83ce73b768a59d52fc
5
+ SHA512:
6
+ metadata.gz: d0f76ac573b55f6d5f64736f4e93e9cc69c2041a330c710ccba868281e8dea4332b4f66ccbac599722aad7780c5f043e053d3f1d0766e6242c761d86bc4a31fe
7
+ data.tar.gz: 96df913fec9f940d1f505dafc5b41a210e2717cdf54273fc6936c151c416f2ed094bc1274b527a8403fe408e2a8f4bb03ed07fbbca443f2adf2ff1bf6fcd91c2
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .idea/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,4 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+ Documentation:
4
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jiraclient.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 James Ridgway
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # JIRA Client
2
+ JiraClient is a simple API client for JIRA, written in Ruby.
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'JiraClient'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install JiraClient
18
+
19
+ ## Development
20
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
21
+
22
+ To install this gem onto your local machine, run `bundle exec rake install`.
23
+
24
+ ## Contributing
25
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jamesridgway/jiraclient.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'jiraclient'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ include Jiraclient
14
+ require 'irb'
15
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jiraclient/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'JiraClient'
8
+ spec.version = JiraClient::VERSION
9
+ spec.authors = ['James Ridgway']
10
+ spec.email = ['myself@james-ridgway.co.uk']
11
+
12
+ spec.summary = 'A JIRA API client'
13
+ spec.description = 'A JIRA API client'
14
+ spec.homepage = 'http://www.james-ridgway.co.uk'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.10'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rspec'
24
+ spec.add_dependency 'httparty', '~> 0.13'
25
+ end
@@ -0,0 +1,16 @@
1
+ require 'uri'
2
+ module JiraClient
3
+ module Agile
4
+ class AgileBase
5
+ def querystring_options(options)
6
+ values = {}
7
+
8
+ values['startAt'] = options[:start_at] unless options[:start_at].nil?
9
+ values['maxResults'] = options[:max_results] unless options[:max_results].nil?
10
+
11
+ return '' if values.empty?
12
+ "?#{URI.encode_www_form(values)}"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ require 'httparty'
2
+ require 'jiraclient/agile/boards'
3
+ module JiraClient
4
+ module Agile
5
+ class Agile
6
+ include JiraClient::Agile
7
+ def initialize(base_uri, options)
8
+ @base_uri = base_uri
9
+ @global_options = options
10
+ end
11
+
12
+ def boards
13
+ Boards.new(@base_uri, @global_options)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,24 @@
1
+ require 'httparty'
2
+ require 'jiraclient/agile/AgileBase'
3
+ module JiraClient
4
+ module Agile
5
+ class Boards < AgileBase
6
+ include HTTParty
7
+
8
+ def initialize(base_uri, options)
9
+ self.class.base_uri base_uri
10
+ @global_options = options
11
+ end
12
+
13
+ def all(options = {})
14
+ options.merge!(@global_options)
15
+ self.class.get("/rest/agile/1.0/board/#{querystring_options(options)}", options)
16
+ end
17
+
18
+ def get(boardId, options = {})
19
+ options.merge!(@global_options)
20
+ self.class.get("/rest/agile/1.0/board/'#{boardId}", options)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ require 'jiraclient/agile/agile'
2
+ require 'jiraclient/projects'
3
+
4
+ module JiraClient
5
+ class Client
6
+ attr_reader :base_uri
7
+
8
+ def initialize(base_uri, username = nil, password = nil)
9
+ @base_uri = base_uri
10
+
11
+ @options = {}
12
+ @options[:basic_auth] = { username: username, password: password } if !username.nil? || !password.nil?
13
+ end
14
+
15
+ def agile
16
+ Agile::Agile.new(@base_uri, @options)
17
+ end
18
+
19
+ def projects
20
+ Projects.new(@base_uri, @options)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ require 'httparty'
2
+ module JiraClient
3
+ class Projects
4
+ include HTTParty
5
+
6
+ def initialize(base_uri, options)
7
+ self.class.base_uri base_uri
8
+ @global_options = options
9
+ end
10
+
11
+ def all(options = {})
12
+ options.merge!(@global_options)
13
+ self.class.get('/rest/api/2/project', options)
14
+ end
15
+
16
+ def get(projectIdOrKey, options = {})
17
+ options.merge!(@global_options)
18
+ self.class.get("/rest/api/2/project'#{projectIdOrKey}", options)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module JiraClient
2
+ VERSION = '0.0.1'
3
+ end
data/lib/jiraclient.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'jiraclient/version'
2
+ require 'jiraclient/client'
3
+
4
+ module JiraClient
5
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: JiraClient
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - James Ridgway
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: httparty
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.13'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.13'
69
+ description: A JIRA API client
70
+ email:
71
+ - myself@james-ridgway.co.uk
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".rubocop.yml"
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - jiraclient.gemspec
86
+ - lib/jiraclient.rb
87
+ - lib/jiraclient/agile/AgileBase.rb
88
+ - lib/jiraclient/agile/agile.rb
89
+ - lib/jiraclient/agile/boards.rb
90
+ - lib/jiraclient/client.rb
91
+ - lib/jiraclient/projects.rb
92
+ - lib/jiraclient/version.rb
93
+ homepage: http://www.james-ridgway.co.uk
94
+ licenses:
95
+ - MIT
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.4.8
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: A JIRA API client
117
+ test_files: []