youtrack 0.0.7 → 0.0.8

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: 3748058fee393084318fe12d0ad64da23f7ffbbd
4
- data.tar.gz: 62f237bcbdd3979fb23b45d56a0e302fe81dc92a
3
+ metadata.gz: b49b0b2fa1572425997a8638aed4498b15c8169b
4
+ data.tar.gz: 6aab1f47e3f3d7d5b0af1ae408d1a6f1dd07eb01
5
5
  SHA512:
6
- metadata.gz: 6a2881cc03b50f271e650ed30b3574113d873d14f34f6a28060d91aff7b72cad39a172347f5e091cb96c9e65952c96cbd67f6c9130c64ec9f538fc23ae38e982
7
- data.tar.gz: 8967a20c522616ce0e1d6641793b6a7136e34b38e35dbd04771f5d148f209c0a7029c29035bdb1f4bcd3b6d9937a1575d444b9b52f18d5d4e40681d9aa731a6e
6
+ metadata.gz: 4b6b76023f8477b95215d897019837f6c6132c0ab6e0a3c669010d76f76bced792c4726332072a22181fd39c2a316c466e80101b4221910bc228cdd5816f0b89
7
+ data.tar.gz: 6d33cc644eec81607418b502e0a3bd90a22188170353fc054f5db7532e6b2981bcb7efd13bb2b594132b402c3c32deed8b5cc54da8d2caf3550520f5b0da7aad
@@ -0,0 +1,12 @@
1
+ require "youtrack"
2
+
3
+ # Setup the client configuration
4
+ client = Youtrack::Client.new do |c|
5
+ c.url = "http://example.your-youtrack.com"
6
+ c.login = "demo"
7
+ c.password = "demo"
8
+ end
9
+
10
+ # connect to the youtrack endpoint
11
+ # and save cookies in the client object
12
+ client.connect!
@@ -0,0 +1,53 @@
1
+ require "youtrack"
2
+
3
+ # Setup the client configuration
4
+ client = Youtrack::Client.new do |c|
5
+ c.url = "http://example.your-youtrack.com"
6
+ c.login = "demo"
7
+ c.password = "demo"
8
+ end
9
+
10
+ # connect to the youtrack endpoint
11
+ # and save cookies in the client object
12
+ client.connect!
13
+
14
+
15
+ # Get the issue resource inheriting cookies
16
+ # from client
17
+ issue_resource = client.issues
18
+
19
+ # Find an issue by ID
20
+ issue_resource.find("TT-6")
21
+
22
+ # Check if an issue exists
23
+ issue_resource.exists?("TT-6")
24
+
25
+ # Getting issue associated data
26
+ issue_resource.get_history_for("TT-6")
27
+ issue_resource.get_changes_for("TT-6")
28
+ issue_resource.get_attachments_for("TT-6")
29
+ issue_resource.get_comments_for("TT-6")
30
+ issue_resource.get_links_for("TT-6")
31
+
32
+ # Create an Issue
33
+ issue_resource.create(
34
+ project: "TT",
35
+ summary: "An example Bug",
36
+ description: "This Bug is evil"
37
+ )
38
+
39
+ # Update an Issue
40
+ issue_id = "TT-6"
41
+ issue_resource.update( issue_id , summary: "Evil Bug")
42
+
43
+ # Delete
44
+ issue_resource.destroy(issue_id)
45
+
46
+ # Add attachments to an issue
47
+ data = File.open("/tmp/dummy.txt")
48
+ content_type = "text/plain"
49
+ filename = "dummy.txt"
50
+ issue_resource.add_attachment(issue_id, data, content_type, filename )
51
+
52
+ # Add comments to an issue
53
+ issue_resource.add_comment(issue_id, comment: "This bug has been fixed")
@@ -0,0 +1,48 @@
1
+ require "youtrack"
2
+
3
+ # Setup the client configuration
4
+ client = Youtrack::Client.new do |c|
5
+ c.url = "http://example.your-youtrack.com"
6
+ c.login = "demo"
7
+ c.password = "demo"
8
+ end
9
+
10
+ # connect to the youtrack endpoint
11
+ # and save cookies in the client object
12
+ client.connect!
13
+
14
+
15
+
16
+ # create a project resource
17
+ # that inherits the connection
18
+ # from the client
19
+ project_resource = client.projects
20
+
21
+ # Get all accessible projects
22
+ project_list = project_resource.get_accessible_projects
23
+
24
+ # Get all issues for a particular project
25
+ project_id = "TT"
26
+ issue_list = project_resource.get_issues_for(project_id)
27
+
28
+ # These methods require that the login/password user
29
+ # have admin privileges
30
+
31
+ # Get all projects
32
+ project_resource.all
33
+
34
+ # Find a project by ID (shortName in youTrack vernacular)
35
+ project_resource.find("TT")
36
+
37
+ # Delete a project
38
+ project_resource.destroy("TT")
39
+
40
+ # Create a project
41
+ # All are required except description
42
+ project_resource.create(
43
+ projectId: "CC",
44
+ projectName: "Cool Cats",
45
+ startingNumber: 4,
46
+ projectLeadLogin: "demo",
47
+ description: "A Project about really awesome cats"
48
+ )
data/examples/users.rb ADDED
File without changes
@@ -4,7 +4,7 @@ module Youtrack
4
4
  # ==================
5
5
  # USER Methods
6
6
  # ==================
7
- def accessible_projects
7
+ def get_accessible_projects
8
8
  get('project/all')
9
9
  response.parsed_response
10
10
  end
@@ -50,4 +50,4 @@ module Youtrack
50
50
  end
51
51
 
52
52
  end
53
- end
53
+ end
@@ -1,3 +1,3 @@
1
1
  module Youtrack
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -0,0 +1,28 @@
1
+ require "spec_helper"
2
+
3
+ describe Youtrack::User do
4
+ let(:users) do
5
+ client = Youtrack::Client.new do |c|
6
+ c.url = "https://example.com"
7
+ c.login = "test"
8
+ c.password = "test"
9
+ end
10
+ client.users
11
+ end
12
+
13
+ describe "api methods" do
14
+ it "#current" do
15
+ users.method(:current).arity.should eq(0)
16
+ end
17
+
18
+ it "#get_by_login" do
19
+ users.method(:get_by_login).arity.should eq(1)
20
+ end
21
+
22
+ it "#get_saved_searches_for" do
23
+ users.method(:get_saved_searches_for).arity.should eq(1)
24
+ end
25
+
26
+ end
27
+
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Faucett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-25 00:00:00.000000000 Z
11
+ date: 2014-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -124,6 +124,10 @@ files:
124
124
  - LICENSE.txt
125
125
  - README.md
126
126
  - Rakefile
127
+ - examples/authentication.rb
128
+ - examples/issues.rb
129
+ - examples/projects.rb
130
+ - examples/users.rb
127
131
  - features/client/new_client_session.feature
128
132
  - features/step_definitions/client/client_steps.rb
129
133
  - features/support/env.rb
@@ -141,6 +145,7 @@ files:
141
145
  - spec/fixtures/login_header.json
142
146
  - spec/spec_helper.rb
143
147
  - spec/youtrack/client_spec.rb
148
+ - spec/youtrack/resources/user_spec.rb
144
149
  - youtrack.gemspec
145
150
  homepage: http://jwaterfaucett.github.io/youtrack/
146
151
  licenses:
@@ -162,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
167
  version: '0'
163
168
  requirements: []
164
169
  rubyforge_project:
165
- rubygems_version: 2.0.6
170
+ rubygems_version: 2.0.3
166
171
  signing_key:
167
172
  specification_version: 4
168
173
  summary: A Ruby REST API Client for JetBrains youTrack software
@@ -177,3 +182,4 @@ test_files:
177
182
  - spec/fixtures/login_header.json
178
183
  - spec/spec_helper.rb
179
184
  - spec/youtrack/client_spec.rb
185
+ - spec/youtrack/resources/user_spec.rb