jira-ruby-dmg 0.1.34 → 0.1.35

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: 344b6531162b0fe6da493902685f3e98a06580c9
4
- data.tar.gz: 1b3f5b6b08afb474c9b7718ab7c989707f1e0abb
3
+ metadata.gz: 5a0f81fc1d40fe0f4dac896deaa34a200fa495ec
4
+ data.tar.gz: 67e0cc292b145668d679de0e411b6f79eb14d722
5
5
  SHA512:
6
- metadata.gz: 8fe530ec61d7d05382d7466190372e1769ee23a1a1d4205f5ae19283dd08eddbd2586f9e73bfd424248cf6f9a98cb4458f66530889bb572ce561f774600dfbb8
7
- data.tar.gz: be0e710435d8cdbda7cc47d398e1614754fef74fe7cbfe8f02cee347289a455c9bc33bfb9d1d78934a7360f01a8d2c404582809a8a78fce00bab4be52759b892
6
+ metadata.gz: 84e759d78c9090afb3f3588bbf220d1bd804bf4b4a682a503359be54a1c4b711fa1dff08c868ab2c14a8e8bd438ade9a7176ceeb822cfa45d7f478e55ee1890a
7
+ data.tar.gz: ec5f521a0a8ae8441e7b08f3f16997cabdb7b7e6827dd0daca1500dddd7ccf0c42abf4012875eabd05a30019c1e00c709b9ced8a4a3439c27db1bb5c8b3b0d92
@@ -14,7 +14,9 @@ module JIRA
14
14
 
15
15
  if response == :expired
16
16
  cache_object.delete(key)
17
- cache_file(uri, 'w+').write(Marshal.dump(cache_object))
17
+ file = cache_file(uri, 'w+')
18
+ file.write(Marshal.dump(cache_object))
19
+ file.close
18
20
  nil
19
21
  else
20
22
  response
@@ -51,15 +53,14 @@ module JIRA
51
53
  end
52
54
 
53
55
  def cache(uri)
54
- begin
55
56
  if File.exists? cache_path(uri)
56
- Marshal.restore(cache_file(uri, 'r+b').read())
57
+ file = cache_file(uri, 'r+b')
58
+ cache_content = Marshal.restore(file.read())
59
+ file.close
60
+ cache_content
57
61
  else
58
62
  {}
59
63
  end
60
- rescue
61
- binding.pry
62
- end
63
64
  end
64
65
 
65
66
  def cache_key(uri)
@@ -2,12 +2,22 @@ module JIRA
2
2
  module Resource
3
3
 
4
4
  class UserFactory < JIRA::BaseFactory # :nodoc:
5
+ delegate_to_target_class :all, :find, :collection_path, :singular_path, :find_by_group
5
6
  end
6
7
 
7
8
  class User < JIRA::Base
8
9
  def self.singular_path(client, key, prefix = '/')
9
10
  collection_path(client, prefix) + '?username=' + key
10
11
  end
12
+
13
+ def self.find_by_group(client, group_name)
14
+ url = client.options[:rest_base_path] + "/group?groupname=#{group_name}&expand=users"
15
+ response = client.get(url)
16
+ json = parse_json(response.body)
17
+ json['users']['items'].map do |user|
18
+ client.User.build(user)
19
+ end
20
+ end
11
21
  end
12
22
 
13
23
  end
data/lib/jira/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module JIRA
2
- VERSION = "0.1.34"
2
+ VERSION = "0.1.35"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-ruby-dmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - ThisIs! DMG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties