sprintly-data-ruby 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06e8b3045ff45dd6dee0cfd7d516ef749c9ef5b5
4
- data.tar.gz: 904354afb6b74a903bbab5629f09b30f47ffd9ff
3
+ metadata.gz: 275dc8e614da2efd85a2fc0fbba5da3fe715d3c8
4
+ data.tar.gz: c5ada177d97a1467e0336d20aaca94c43a151345
5
5
  SHA512:
6
- metadata.gz: f851594f9bd583f36b51f91272ce976ec1807885e7ba9a9da65f384b388b2433130d9a33d4c5c4ff35a0a8f619d0b84e4f90904f88623088a4c6b1a346d772c0
7
- data.tar.gz: 35bb0061625ab88cd14c9a9d1dd548e04fcbd058f5600e15324a2896c32ecc5ce268b42d284baae28e8be517c6ed64ddbe1d7f1076139a086f86a50d712961d5
6
+ metadata.gz: 59f972a2435b090af6f438128b46f06243e9b7221dfe39bd4e19012d85715d8238c3d0a57724dc25ff21ca04af7c7aa1c46549e3886cb288ab2cec539a64329e
7
+ data.tar.gz: 1b764d1356ac24d17d1d1133a86d7d552e5376988017d9a6dd41dd05f1f786898efcd43ab914c54a6ec0175e7a526b75d47938865e59ed8532ad9777641ccb4c
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
- test/fixtures
1
+ test/fixtures
2
+ *.gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sprintly-data-ruby (0.1.0)
4
+ sprintly-data-ruby (0.2.1)
5
5
  faraday
6
6
  json
7
7
 
@@ -34,10 +34,10 @@ PLATFORMS
34
34
  ruby
35
35
 
36
36
  DEPENDENCIES
37
- bundler (~> 1.10)
37
+ bundler
38
38
  minitest
39
39
  pry
40
- rake (~> 10.0)
40
+ rake
41
41
  sprintly-data-ruby!
42
42
  vcr
43
43
  webmock
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Sprintly::Data::Ruby
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sprintly/data/ruby`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![wercker status](https://app.wercker.com/status/5e214b2e6c5704189acc37a7c049b8e7/m "wercker status")](https://app.wercker.com/project/bykey/5e214b2e6c5704189acc37a7c049b8e7)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ The Sprintly Data Ruby gem easily fetches Products and Items for an authorized Sprintly user.
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,26 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ Before using the gem, you must set environment variables for `SPRINTLY_EMAIL` and `SPRINTLY_API_KEY`. You can find your Sprintly API key from the User Account page in Sprintly.
26
+
27
+ An example method call to receive all products for the authorized Sprintly user looks like this:
28
+
29
+ ```
30
+ Sprintly::Product.all
31
+ ```
32
+
33
+ The gem also contains an instance method to retrieve all stories that are of a certain status for any given product. The following will return all items in the backlog for the first Sprintly Product returned by the `.all` query.
34
+
35
+ ```
36
+ Sprintly::Product.all.first.get_items_by_status("backlog")
37
+ ```
38
+
39
+
40
+ You can also see all items for a given product by replacing the `product_id` below with a valid Sprintly Product ID.
41
+
42
+ ```
43
+ Sprintly::Item.for_product(product_id)
44
+ ```
26
45
 
27
46
  ## Development
28
47
 
@@ -32,10 +51,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
51
 
33
52
  ## Contributing
34
53
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/sprintly-data-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
54
+ Bug reports and pull requests are welcome on GitHub at https://github.com/quickleft/sprintly-data-ruby.
36
55
 
37
56
 
38
57
  ## License
39
58
 
40
59
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
60
 
61
+
62
+
@@ -14,6 +14,12 @@ module Sprintly
14
14
  raw_items.map { |raw_item| new(raw_item) }
15
15
  end
16
16
 
17
+ def self.all_for_product(product_id)
18
+ response = Sprintly::Connection.get("products/#{product_id}/items.json?status=someday,backlog,in-progress,completed,accepted")
19
+ raw_items = JSON.parse(response.body)
20
+ raw_items.map { |raw_item| new(raw_item) }
21
+ end
22
+
17
23
  def initialize(raw_item)
18
24
  WHITELISTED_ATTRIBUTES.each do |attr|
19
25
  if raw_item.has_key?(attr)
@@ -1,3 +1,3 @@
1
1
  module Sprintly
2
- VERSION = "0.2.0"
3
- end
2
+ VERSION = "0.2.1"
3
+ end
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.10"
23
- spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "bundler"
23
+ spec.add_development_dependency "rake"
24
24
  spec.add_development_dependency "minitest"
25
25
  spec.add_development_dependency "vcr"
26
26
  spec.add_development_dependency "webmock"
@@ -0,0 +1,8 @@
1
+ box: wercker/ruby
2
+ ruby: 2.2.2
3
+ build:
4
+ steps:
5
+ - bundle-install
6
+ - script:
7
+ name: test
8
+ code: bundle exec rake test
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprintly-data-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quick Left
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-14 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +146,7 @@ files:
146
146
  - lib/sprintly-data-ruby/version.rb
147
147
  - sprintly-data-ruby-0.1.0.gem
148
148
  - sprintly-data-ruby.gemspec
149
+ - wercker.yml
149
150
  homepage: https://github.com/quickleft/sprintly-data-ruby
150
151
  licenses:
151
152
  - BSD
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  version: '0'
167
168
  requirements: []
168
169
  rubyforge_project:
169
- rubygems_version: 2.4.8
170
+ rubygems_version: 2.4.5
170
171
  signing_key:
171
172
  specification_version: 4
172
173
  summary: Sprintly API interface for Ruby applications