jiralicious 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.document +5 -5
  2. data/.gitignore +11 -11
  3. data/.rspec +1 -1
  4. data/.ruby-gemset +1 -1
  5. data/.travis.yml +10 -10
  6. data/Gemfile +4 -4
  7. data/LICENSE +22 -22
  8. data/README.md +99 -94
  9. data/Rakefile +16 -16
  10. data/gemfiles/newest.gemfile +3 -3
  11. data/gemfiles/oldest.gemfile +6 -6
  12. data/jiralicious.gemspec +37 -37
  13. data/lib/jiralicious.rb +2 -0
  14. data/lib/jiralicious/base.rb +226 -226
  15. data/lib/jiralicious/component.rb +103 -0
  16. data/lib/jiralicious/custom_field_option.rb +45 -45
  17. data/lib/jiralicious/errors.rb +27 -27
  18. data/lib/jiralicious/field.rb +58 -58
  19. data/lib/jiralicious/issue/fields.rb +197 -197
  20. data/lib/jiralicious/issue/watchers.rb +92 -92
  21. data/lib/jiralicious/project.rb +116 -64
  22. data/lib/jiralicious/session.rb +61 -61
  23. data/lib/jiralicious/version.rb +4 -4
  24. data/lib/jiralicious/versions.rb +150 -0
  25. data/spec/components_spec.rb +74 -0
  26. data/spec/configuration_spec.rb +41 -41
  27. data/spec/field_parser_spec.rb +73 -73
  28. data/spec/fixtures/avatar.json +6 -6
  29. data/spec/fixtures/avatar_custom.json +15 -15
  30. data/spec/fixtures/avatar_list.json +15 -15
  31. data/spec/fixtures/avatar_temp.json +6 -6
  32. data/spec/fixtures/comment_single.json +28 -28
  33. data/spec/fixtures/component.json +39 -0
  34. data/spec/fixtures/component_ric.json +4 -0
  35. data/spec/fixtures/component_updated.json +39 -0
  36. data/spec/fixtures/jira.yml +7 -7
  37. data/spec/fixtures/project_componets.json +80 -0
  38. data/spec/fixtures/project_versions.json +22 -0
  39. data/spec/fixtures/test.json +23 -23
  40. data/spec/fixtures/version.json +11 -0
  41. data/spec/fixtures/version_ric.json +5 -0
  42. data/spec/fixtures/version_uic.json +4 -0
  43. data/spec/fixtures/version_updated.json +11 -0
  44. data/spec/issue_spec.rb +385 -385
  45. data/spec/jiralicious_spec.rb +16 -16
  46. data/spec/project_spec.rb +25 -2
  47. data/spec/search_result_spec.rb +54 -54
  48. data/spec/support/configuration.rb +11 -11
  49. data/spec/support/http.rb +147 -111
  50. data/spec/versions_spec.rb +84 -0
  51. metadata +189 -170
  52. checksums.yaml +0 -7
data/.document CHANGED
@@ -1,5 +1,5 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- *.swp
6
- *.swo
7
- TAGS
8
- vendor/bundle
9
- *~
10
- \#*#
11
- *.#*
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ *.swp
6
+ *.swo
7
+ TAGS
8
+ vendor/bundle
9
+ *~
10
+ \#*#
11
+ *.#*
12
12
  /bin
data/.rspec CHANGED
@@ -1 +1 @@
1
- --color
1
+ --color
@@ -1 +1 @@
1
- jiralicious
1
+ jiralicious
@@ -1,10 +1,10 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- - 1.9.2
6
- - 1.8.7
7
-
8
- gemfile:
9
- - gemfiles/oldest.gemfile
10
- - gemfiles/newest.gemfile
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - 1.9.2
6
+ - 1.8.7
7
+
8
+ gemfile:
9
+ - gemfiles/oldest.gemfile
10
+ - gemfiles/newest.gemfile
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in jiralicious.gemspec
4
- gemspec
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in jiralicious.gemspec
4
+ gemspec
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2010 Jason Stewart
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2010 Jason Stewart
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,94 +1,99 @@
1
- # jiralicious
2
-
3
- [![Build Status](https://travis-ci.org/dorack/jiralicious.png)](https://travis-ci.org/dorack/jiralicious)
4
-
5
- ## Examples:
6
-
7
- Before doing anything, you must configure your session:
8
-
9
- Jiralicious.configure do |config|
10
- # Leave out username and password
11
- config.username = "youruser"
12
- config.password = "yourpass"
13
- config.uri = "http://example.com/foo/bar"
14
- config.api_version = "latest"
15
- config.auth_type = :basic
16
- end
17
-
18
- Session configuration is also available via YAML:
19
-
20
- jira:
21
- username: youruser
22
- password: yourpass
23
- uri: https://example.com/
24
-
25
-
26
- Jiralicious.load_yml(File.expand_path("/path/to/jira.yml"))
27
-
28
- Search for issues:
29
-
30
- result = Jiralicious.search("key = HSP-1") # Any jql can be used here
31
- result.issues
32
-
33
- Finding a single issue:
34
-
35
- issue = Jiralicious::Issue.find("HSP-1")
36
- issue.key => "HSP-1"
37
-
38
-
39
- ## Deprecation Warning
40
-
41
- Default auth type is now Basic auth. Cookie auth will be deprecated in the next version.
42
-
43
- ## Changes in 0.4.2
44
-
45
- * Opened up HTTParty to any version.
46
- * Issue.new now works if provided a hash set.
47
- * Error is thrown if the Jira key is invalid.
48
- * Error is thrown if issue cannot be created during new opperation.
49
- * Corrected and Updated RSPEC
50
-
51
- ## Changes from 0.4.0 to 0.4.1
52
-
53
- * Initial implementation of OAuth.
54
- ** Note: the system does not support webhooks at this time. **
55
-
56
- ## Changes from 0.3.0
57
-
58
- * User and Avatars are now supported.
59
-
60
- ## Changes from 0.2.2
61
-
62
- * For more flexible error handling, Return the full HTTParty response instead of parsing errorMessages. **NOTE: This API change may break exising error handling code. Please update your application code to parse the response from JiraError, TransitionError, and IssueNotFound.**
63
-
64
-
65
- ## Changes from 0.1.0
66
-
67
- * Issues can be created, updated, or deleted as needed. This includes most components such as comments, transitions, and assignees.
68
- * Projects can now be accessed as well as related issues
69
- * A Field class has been added to allow proper access to the meta data for create, edit, and update requests. This data is searchable via Hash or dot notation
70
- * Some sections can now be lazy loaded
71
- * Configuration can be loaded via yaml
72
-
73
-
74
- ## Contributors
75
-
76
- * Stanley Handschuh (dorack)
77
- * Mike Fiedler (miketheman)
78
- * Girish Sonawane (girishso)
79
- * Jan Lindblom (janlindblom)
80
-
81
- ## Contributing to jiralicious
82
-
83
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
84
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
85
- * Fork the project
86
- * Start a feature/bugfix branch
87
- * Commit and push until you are happy with your contribution
88
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
89
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
90
-
91
- ## Copyright
92
-
93
- Copyright (c) 2013 Jason Stewart. See LICENSE for
94
- further details.
1
+ # jiralicious
2
+
3
+ [![Build Status](https://travis-ci.org/dorack/jiralicious.png)](https://travis-ci.org/dorack/jiralicious)
4
+
5
+ ## Examples:
6
+
7
+ Before doing anything, you must configure your session:
8
+
9
+ Jiralicious.configure do |config|
10
+ # Leave out username and password
11
+ config.username = "youruser"
12
+ config.password = "yourpass"
13
+ config.uri = "http://example.com/foo/bar"
14
+ config.api_version = "latest"
15
+ config.auth_type = :basic
16
+ end
17
+
18
+ Session configuration is also available via YAML:
19
+
20
+ jira:
21
+ username: youruser
22
+ password: yourpass
23
+ uri: https://example.com/
24
+
25
+
26
+ Jiralicious.load_yml(File.expand_path("/path/to/jira.yml"))
27
+
28
+ Search for issues:
29
+
30
+ result = Jiralicious.search("key = HSP-1") # Any jql can be used here
31
+ result.issues
32
+
33
+ Finding a single issue:
34
+
35
+ issue = Jiralicious::Issue.find("HSP-1")
36
+ issue.key => "HSP-1"
37
+
38
+
39
+ ## Deprecation Warning
40
+
41
+ Default auth type is now Basic auth. Cookie auth will be deprecated in the next version.
42
+
43
+ ## Changes in 0.5.0
44
+ * Added restriction for Hashie to not use version 3.0.0 and above
45
+ * Added Component class and included all API functionality
46
+ * Added Version class and included all API functionality
47
+
48
+ ## Changes in 0.4.2
49
+
50
+ * Opened up HTTParty to any version.
51
+ * Issue.new now works if provided a hash set.
52
+ * Error is thrown if the Jira key is invalid.
53
+ * Error is thrown if issue cannot be created during new opperation.
54
+ * Corrected and Updated RSPEC
55
+
56
+ ## Changes from 0.4.0 to 0.4.1
57
+
58
+ * Initial implementation of OAuth.
59
+ ** Note: the system does not support webhooks at this time. **
60
+
61
+ ## Changes from 0.3.0
62
+
63
+ * User and Avatars are now supported.
64
+
65
+ ## Changes from 0.2.2
66
+
67
+ * For more flexible error handling, Return the full HTTParty response instead of parsing errorMessages. **NOTE: This API change may break exising error handling code. Please update your application code to parse the response from JiraError, TransitionError, and IssueNotFound.**
68
+
69
+
70
+ ## Changes from 0.1.0
71
+
72
+ * Issues can be created, updated, or deleted as needed. This includes most components such as comments, transitions, and assignees.
73
+ * Projects can now be accessed as well as related issues
74
+ * A Field class has been added to allow proper access to the meta data for create, edit, and update requests. This data is searchable via Hash or dot notation
75
+ * Some sections can now be lazy loaded
76
+ * Configuration can be loaded via yaml
77
+
78
+
79
+ ## Contributors
80
+
81
+ * Stanley Handschuh (dorack)
82
+ * Mike Fiedler (miketheman)
83
+ * Girish Sonawane (girishso)
84
+ * Jan Lindblom (janlindblom)
85
+
86
+ ## Contributing to jiralicious
87
+
88
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
89
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
90
+ * Fork the project
91
+ * Start a feature/bugfix branch
92
+ * Commit and push until you are happy with your contribution
93
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
94
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
95
+
96
+ ## Copyright
97
+
98
+ Copyright (c) 2013 Jason Stewart. See LICENSE for
99
+ further details.
data/Rakefile CHANGED
@@ -1,16 +1,16 @@
1
- require 'bundler'
2
- require 'rspec/core'
3
- require 'rspec/core/rake_task'
4
-
5
- Bundler::GemHelper.install_tasks
6
-
7
- RSpec::Core::RakeTask.new(:spec) do |spec|
8
- spec.pattern = FileList['spec/**/*_spec.rb']
9
- end
10
-
11
- RSpec::Core::RakeTask.new(:rcov) do |spec|
12
- spec.pattern = 'spec/**/*_spec.rb'
13
- spec.rcov = true
14
- end
15
-
16
- task :default => :spec
1
+ require 'bundler'
2
+ require 'rspec/core'
3
+ require 'rspec/core/rake_task'
4
+
5
+ Bundler::GemHelper.install_tasks
6
+
7
+ RSpec::Core::RakeTask.new(:spec) do |spec|
8
+ spec.pattern = FileList['spec/**/*_spec.rb']
9
+ end
10
+
11
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
12
+ spec.pattern = 'spec/**/*_spec.rb'
13
+ spec.rcov = true
14
+ end
15
+
16
+ task :default => :spec
@@ -1,3 +1,3 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => "../"
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec :path => "../"
@@ -1,6 +1,6 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'json', '1.6.0'
4
- gem 'httparty', '0.10.0'
5
-
6
- gemspec :path => "../"
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'json', '1.6.0'
4
+ gem 'httparty', '0.10.0'
5
+
6
+ gemspec :path => "../"
@@ -1,37 +1,37 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "jiralicious/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "jiralicious"
7
- s.version = Jiralicious::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.homepage = "http://github.com/jstewart/jiralicious"
10
- s.license = "MIT"
11
- s.summary = %Q{A Ruby library for interacting with JIRA's REST API}
12
- s.description = %Q{A Ruby library for interacting with JIRA's REST API}
13
- s.email = "jstewart@fusionary.com"
14
- s.authors = ["Jason Stewart"]
15
- s.add_runtime_dependency 'crack', '~> 0.1.8'
16
- if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9.2')
17
- s.add_runtime_dependency 'httparty', '>= 0.10'
18
- else
19
- s.add_runtime_dependency 'httparty', '>= 0.10', '< 0.12.0'
20
- end
21
- s.add_runtime_dependency 'hashie', '>= 1.1'
22
- s.add_runtime_dependency 'json', '>= 1.6', '< 1.9.0'
23
- s.add_runtime_dependency 'oauth'
24
- if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('1.9.0')
25
- s.add_runtime_dependency 'nokogiri'
26
- else
27
- s.add_runtime_dependency 'nokogiri', '< 1.6'
28
- end
29
- s.add_development_dependency 'rspec', '~> 2.6'
30
- s.add_development_dependency 'rake'
31
- s.add_development_dependency 'fakeweb', '~> 1.3.0'
32
-
33
- s.files = `git ls-files`.split("\n")
34
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
35
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
36
- s.require_paths = ["lib"]
37
- end
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "jiralicious/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "jiralicious"
7
+ s.version = Jiralicious::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.homepage = "http://github.com/jstewart/jiralicious"
10
+ s.license = "MIT"
11
+ s.summary = %Q{A Ruby library for interacting with JIRA's REST API}
12
+ s.description = %Q{A Ruby library for interacting with JIRA's REST API}
13
+ s.email = "jstewart@fusionary.com"
14
+ s.authors = ["Jason Stewart"]
15
+ s.add_runtime_dependency 'crack', '~> 0.1.8'
16
+ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9.2')
17
+ s.add_runtime_dependency 'httparty', '>= 0.10'
18
+ else
19
+ s.add_runtime_dependency 'httparty', '>= 0.10', '< 0.12.0'
20
+ end
21
+ s.add_runtime_dependency 'hashie', '>= 1.1', '< 3.0.0'
22
+ s.add_runtime_dependency 'json', '>= 1.6', '< 1.9.0'
23
+ s.add_runtime_dependency 'oauth'
24
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('1.9.0')
25
+ s.add_runtime_dependency 'nokogiri'
26
+ else
27
+ s.add_runtime_dependency 'nokogiri', '< 1.6'
28
+ end
29
+ s.add_development_dependency 'rspec', '~> 2.6'
30
+ s.add_development_dependency 'rake'
31
+ s.add_development_dependency 'fakeweb', '~> 1.3.0'
32
+
33
+ s.files = `git ls-files`.split("\n")
34
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
35
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
36
+ s.require_paths = ["lib"]
37
+ end
@@ -14,6 +14,8 @@ require 'jiralicious/issue/fields'
14
14
  require 'jiralicious/issue/comment'
15
15
  require 'jiralicious/issue/watchers'
16
16
  require 'jiralicious/issue/transitions'
17
+ require 'jiralicious/component'
18
+ require 'jiralicious/versions'
17
19
  require 'jiralicious/project'
18
20
  require 'jiralicious/project/avatar'
19
21
  require 'jiralicious/search'