contextio 1.7.0 → 1.7.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: 36032da14317097955708cdfde089a2fb5a97268
4
- data.tar.gz: 1e0523dcdeddf86c38e925e82091bfc2f83c0d23
3
+ metadata.gz: c5e2dbe2586d58809974fbc1700cc773d43d6e78
4
+ data.tar.gz: 216fa008cae2c54e0c195020f9405684ebabc777
5
5
  SHA512:
6
- metadata.gz: 4d6dae4942bbc159c1fcd1ca5237f3e59326abf46cefc283ae99133f7ab116e62f643e7aa595e9fa3c538c23cba34d6dff1e990805546c26f28bedb6fa720da1
7
- data.tar.gz: 5f0efc5d25d4d4f1133ea372c8a5e9ac28183f74b8e2db2ebf2d510223247efe2fcbce691c47f750d47dc10adb6c106154c502c14879edfb0eabab518b7d7d4b
6
+ metadata.gz: b4a5f33b09fd9d40bd3702df6333a422d84b259558a574265c73212950ba9eaf53f9bcbf63b432613c04c136dbdab394c219ea97766a58eed66363347c68981b
7
+ data.tar.gz: 03b711445a19b70b57f57502c549e8d33acb55fd42337f29353dcd31fbdbcbfde074b848ceaf40d58e9d051d5aef18dece9bfeb83f94046f0352bbb5ed22d0b0
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes
2
2
 
3
+ ## 1.7.1
4
+
5
+ * Fix bug in `ContextIO::Message#set_flags` that was failing, and also fixes the
6
+ wrong api url it was trying to call. - [Paul Bonaud](https://github.com/popox)
7
+ * Spruce up README, and add CONTRIBUTING and RELEASING guides. - Ben Hamill
8
+
3
9
  ## 1.7.0
4
10
 
5
11
  * Further README updates for clarity. - Johnny Goodman
@@ -0,0 +1,19 @@
1
+ # Contributing
2
+
3
+ Help is gladly welcomed. If you have a feature you'd like to add, it's much more
4
+ likely to get in (or get in faster) the closer you stick to these steps:
5
+
6
+ 1. Open an Issue to talk about it. We can discuss whether it's the right
7
+ direction or maybe help track down a bug, etc.
8
+ 1. Fork the project, and make a branch to work on your feature/fix. Master is
9
+ where you'll want to start from.
10
+ 1. Turn the Issue into a Pull Request. There are several ways to do this, but
11
+ [hub](https://github.com/defunkt/hub) is probably the easiest.
12
+ 1. Make sure your Pull Request includes tests.
13
+ 1. Bonus points if your Pull Request updates `CHANGES.md` to include a summary
14
+ of your changes and your name like the other entries. If the last entry is
15
+ the last release, add a new `## Unreleased` heading.
16
+ 1. *Do not* rev the version number in your pull request.
17
+
18
+ If you don't know how to fix something, even just a Pull Request that includes a
19
+ failing test can be helpful. If in doubt, make an Issue to discuss.
data/README.md CHANGED
@@ -354,26 +354,17 @@ There are some consistent mappings between the requests documented in the
354
354
 
355
355
  ## Contributing
356
356
 
357
- Help is gladly welcomed. If you have a feature you'd like to add, it's much more
358
- likely to get in (or get in faster) the closer you stick to these steps:
357
+ If you'd like to contribute, please see the [contribution guidelines](CONTRIBUTING.md).
359
358
 
360
- 1. Open an Issue to talk about it. We can discuss whether it's the right
361
- direction or maybe help track down a bug, etc.
362
- 1. Fork the project, and make a branch to work on your feature/fix. Master is
363
- where you'll want to start from.
364
- 1. Turn the Issue into a Pull Request. There are several ways to do this, but
365
- [hub](https://github.com/defunkt/hub) is probably the easiest.
366
- 1. Make sure your Pull Request includes tests.
367
- 1. Bonus points if your Pull Request updates `CHANGES.md` to include a summary
368
- of your changes and your name like the other entries. If the last entry is
369
- the last release, add a new `## Unreleased` heading.
370
359
 
371
- If you don't know how to fix something, even just a Pull Request that includes a
372
- failing test can be helpful. If in doubt, make an Issue to discuss.
360
+ ## Releasing
361
+
362
+ Maintainers: Please make sure to follow the [release steps](RELEASING.md) when
363
+ it's time to cut a new release.
373
364
 
374
365
 
375
366
  ## Copyright
376
367
 
377
- Copyright (c) 2012-2013 Context.IO
368
+ Copyright (c) 2012-2014 Context.IO
378
369
 
379
370
  This gem is distributed under the MIT License. See LICENSE.md for details.
@@ -0,0 +1,15 @@
1
+ ## Releasing
2
+
3
+ If you want to push a new version of this gem, do this:
4
+
5
+ 1. Ideally, every Pull Request should already have included an addition to the
6
+ `CHANGES.md` file summarizing the changes and crediting the author(s). It
7
+ doesn't hurt to review this to see if anything needs adding.
8
+ 1. Commit any changes you make.
9
+ 1. Go into version.rb and bump the version number
10
+ [as appopriate](http://semver.org/).
11
+ 1. Go into CHANGES.md and change the "Unlreleased" heading to match the new
12
+ version number.
13
+ 1. Commit these changes with a message like, "Minor version bump," or similar.
14
+ 1. Run `rake release`.
15
+ 1. High five someone nearby.
@@ -33,12 +33,12 @@ class ContextIO
33
33
  # As of this writing, the documented valid flags are: seen, answered,
34
34
  # flagged, deleted, and draft. However, this will send whatever you send it.
35
35
  def set_flags(flag_hash)
36
- args = flag_hash.map({}) do |memo, (flag_name, value)|
36
+ args = flag_hash.inject({}) do |memo, (flag_name, value)|
37
37
  memo[flag_name] = value ? 1 : 0
38
38
  memo
39
39
  end
40
40
 
41
- api.request(:post, resource_url, args)['success']
41
+ api.request(:post, "#{resource_url}/flags", args)['success']
42
42
  end
43
43
 
44
44
  def folders
@@ -1,6 +1,6 @@
1
1
  class ContextIO
2
2
  # @private
3
- VERSION = "1.7.0"
3
+ VERSION = "1.7.1"
4
4
 
5
5
  # The gem version.
6
6
  #
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+ require 'contextio/message'
3
+
4
+ describe ContextIO::Message do
5
+ let(:api) { double('api') }
6
+
7
+ subject { ContextIO::Message.new(api, resource_url: 'resource/url') }
8
+
9
+ describe "#flags" do
10
+ before do
11
+ allow(api).to receive(:request).and_return({'seen' => 0})
12
+ end
13
+
14
+ it "gets to the flags method api" do
15
+ expect(api).to receive(:request).with(
16
+ :get,
17
+ 'resource/url/flags'
18
+ )
19
+
20
+ subject.flags
21
+ end
22
+ end
23
+
24
+ describe "#set_flags" do
25
+ before do
26
+ allow(api).to receive(:request).and_return({'seen' => 1})
27
+ end
28
+
29
+ it "gets to the flags method api" do
30
+ expect(api).to receive(:request).with(
31
+ :post,
32
+ 'resource/url/flags',
33
+ {:seen => 1}
34
+ )
35
+
36
+ subject.set_flags({:seen => true})
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contextio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hamill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-22 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -176,9 +176,11 @@ files:
176
176
  - ".rspec"
177
177
  - ".yardopts"
178
178
  - CHANGES.md
179
+ - CONTRIBUTING.md
179
180
  - Gemfile
180
181
  - LICENSE.md
181
182
  - README.md
183
+ - RELEASING.md
182
184
  - Rakefile
183
185
  - contextio.gemspec
184
186
  - lib/contextio.rb
@@ -231,6 +233,7 @@ files:
231
233
  - spec/unit/contextio/connect_token_collection_spec.rb
232
234
  - spec/unit/contextio/connect_token_spec.rb
233
235
  - spec/unit/contextio/email_settings_spec.rb
236
+ - spec/unit/contextio/message_spec.rb
234
237
  - spec/unit/contextio/oauth_provider_collection_spec.rb
235
238
  - spec/unit/contextio/oauth_provider_spec.rb
236
239
  - spec/unit/contextio/source_collection_spec.rb
@@ -257,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
260
  version: '0'
258
261
  requirements: []
259
262
  rubyforge_project:
260
- rubygems_version: 2.2.0
263
+ rubygems_version: 2.2.2
261
264
  signing_key:
262
265
  specification_version: 4
263
266
  summary: Provides interface to Context.IO
@@ -277,6 +280,7 @@ test_files:
277
280
  - spec/unit/contextio/connect_token_collection_spec.rb
278
281
  - spec/unit/contextio/connect_token_spec.rb
279
282
  - spec/unit/contextio/email_settings_spec.rb
283
+ - spec/unit/contextio/message_spec.rb
280
284
  - spec/unit/contextio/oauth_provider_collection_spec.rb
281
285
  - spec/unit/contextio/oauth_provider_spec.rb
282
286
  - spec/unit/contextio/source_collection_spec.rb