orchestrate.io 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f161128ca77ed5865e374e9706709583f4a7b363
4
- data.tar.gz: 2c396a67015c8778d56bdad2f017774c4a55ae4e
3
+ metadata.gz: 030c4576b297c75a43131f0ee77a6480a3ad54de
4
+ data.tar.gz: 41d62609e2f8f47af724f6c81fdfd55692c8525f
5
5
  SHA512:
6
- metadata.gz: 594f3cd3c7f64758d4b4be901a0fc41da5022eb0543a2481844a0c22638d6b0250fd74c6a14b639568d62b972086baa9c008fab7bb6a8a5def5b3616f47184e6
7
- data.tar.gz: 12231b8ddb65055fafb08fad97872b754b69d4cc889be8b475ff3ae9d39d0cea63318de3217ae99c01b05e5ce6d650ba4dd6f67f61ab80b39701932ea2d1b8bf
6
+ metadata.gz: 8112bd88a96b59c3f70d8b466127f0ef128c02fe916269405650250bda8c90fbaece103c97f6e64420d9fdf415c239e80999b3f133cc9895ea9af4d2ad9c6ebe
7
+ data.tar.gz: 7b62f8740304def1591fbad20dc163a878ed00e75f7df08d291a975681cacd1074029d612b2c2d313565d41e227b100b4d38ffec77b449a9314c43318d17bba0
data/.travis.yml CHANGED
@@ -6,3 +6,7 @@ rvm:
6
6
  branches:
7
7
  only:
8
8
  - master
9
+
10
+ addons:
11
+ code_climate:
12
+ repo_token: 4c822723535747ce3f984b634061775b98ed8cc49dc4537cf1a9e52149502657
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in orchestrate.io.gemspec
4
4
  gemspec
5
+
6
+ gem "codeclimate-test-reporter", group: :test, require: nil
data/README.md CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  A Ruby interface to the [Orchestrate.io](https://orchestrate.io/) API
4
4
 
5
- [![Build
6
- Status](https://travis-ci.org/azukiwasher/ruby-orchestrate.io.png?branch=master)](https://travis-ci.org/azukiwasher/ruby-orchestrate.io)
5
+ [![Gem Version](https://badge.fury.io/rb/orchestrate.io.png)](https://rubygems.org/gems/orchestrate.io)
6
+ [![Build Status](https://travis-ci.org/azukiwasher/ruby-orchestrate.io.png?branch=master)](https://travis-ci.org/azukiwasher/ruby-orchestrate.io)
7
+ [![Code Climate](https://codeclimate.com/repos/529e807189af7e6a3400abff/badges/57dc03031430402a1d74/gpa.png)](https://codeclimate.com/repos/529e807189af7e6a3400abff/feed)
7
8
 
8
9
  ## Installation
9
10
 
@@ -42,7 +43,6 @@ require 'json'
42
43
  @io.key_value :put do
43
44
  collection "foo"
44
45
  key "bar"
45
-  timestamp 1384224213
46
46
  data @json_data
47
47
  end.perform
48
48
 
@@ -55,7 +55,7 @@ end.perform
55
55
  #### Search
56
56
 
57
57
  ```
58
- @io.search do
58
+ @io.search :get do
59
59
  collection "foo"
60
60
  query @query_string
61
61
  end.perform
@@ -68,16 +68,16 @@ end.perform
68
68
  collection "foo"
69
69
  key "bar"
70
70
  type "log"
71
-  timestamp 1384224213
72
71
  data @json_data
72
+  timestamp 1384224213
73
73
  end.perform
74
74
 
75
75
  @io.events :get do
76
76
  collection "foo"
77
77
  key "bar"
78
78
  type "log"
79
-  start 1384224210
80
-  end 1384224213
79
+  from 1384224210
80
+  to 1384224213
81
81
  end.perform
82
82
  ```
83
83
 
@@ -41,6 +41,7 @@ module OrchestrateIo
41
41
  def options
42
42
  options = {}
43
43
  options[:body] = :data
44
+ options[:query] = { timestamp: :timestamp, start: :from, end: :to }
44
45
  options
45
46
  end
46
47
  end
@@ -36,6 +36,7 @@ module OrchestrateIo
36
36
  end
37
37
  end
38
38
  }
39
+ options.delete_if {|k,v| v.empty? if v.is_a? Hash }
39
40
  end
40
41
 
41
42
  def method_missing(method, *args, &block)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module OrchestrateIo
4
- Version = VERSION = "0.1.3"
4
+ Version = VERSION = "0.1.4"
5
5
  end
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe String do
4
+ describe "#camelize" do
5
+ it 'camelizes the given string' do
6
+ string = "hana_moguella"
7
+ expect(string.camelize).to eql "HanaMoguella"
8
+ expect(string).to eql "hana_moguella"
9
+ end
10
+ end
11
+
12
+ describe "#camelize!" do
13
+ it 'camelizes destructively the given string' do
14
+ string = "hana_moguella"
15
+ expect(string.camelize!).to eql "HanaMoguella"
16
+ expect(string).to eql "HanaMoguella"
17
+ end
18
+ end
19
+
20
+ describe "#underscore" do
21
+ it 'snakes the given string' do
22
+ string = "HanaMoguella"
23
+ expect(string.underscore).to eql "hana_moguella"
24
+ expect(string).to eql "HanaMoguella"
25
+ end
26
+ end
27
+
28
+ describe "#underscore!" do
29
+ it 'snakes destructively the given string' do
30
+ string = "HanaMoguella"
31
+ expect(string.underscore!).to eql "hana_moguella"
32
+ expect(string).to eql "hana_moguella"
33
+ end
34
+ end
35
+ end
@@ -11,12 +11,13 @@ describe OrchestrateIo::Events do
11
11
  key "the_godfather"
12
12
  type "comments"
13
13
  data "{\"Text\" :\"It's hard to find a moment in the film that isn't great.\"}"
14
+ timestamp 1386719809
14
15
  end
15
16
  }
16
17
 
17
18
  it "performs a request with the correct options" do
18
19
  client.should_receive(:request).
19
- with(:put, "/v0/films/the_godfather/events/comments", {:body=>"{\"Text\" :\"It's hard to find a moment in the film that isn't great.\"}"})
20
+ with(:put, "/v0/films/the_godfather/events/comments", {:body=>"{\"Text\" :\"It's hard to find a moment in the film that isn't great.\"}",:query=>{:timestamp=>1386719809}}, )
20
21
  request.perform
21
22
  end
22
23
 
@@ -33,12 +34,14 @@ describe OrchestrateIo::Events do
33
34
  collection "films"
34
35
  key "the_godfather"
35
36
  type "comments"
37
+ from 1386719809 # start
38
+ to 1386723374 # end
36
39
  end
37
40
  }
38
41
 
39
42
  it "performs a request with the correct options" do
40
43
  client.should_receive(:request).
41
- with(:get, "/v0/films/the_godfather/events/comments", {})
44
+ with(:get, "/v0/films/the_godfather/events/comments", {:query=>{:start=>1386719809, :end=>1386723374}})
42
45
  request.perform
43
46
  end
44
47
 
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+
2
3
  # This file was generated by the `rspec --init` command. Conventionally, all
3
4
  # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
4
5
  # Require this file using `require "spec_helper"` to ensure that it is only
@@ -6,6 +7,7 @@
6
7
  #
7
8
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
8
9
 
10
+ # Connect code quality with test coverage
9
11
  unless ENV['CI']
10
12
  require 'simplecov'
11
13
  require 'simplecov-rcov'
@@ -23,13 +25,15 @@ require 'rspec'
23
25
  require 'webmock/rspec'
24
26
  require 'json'
25
27
  require 'timecop'
28
+ require "codeclimate-test-reporter"
29
+
30
+ # Keep the client from external requests.
31
+ WebMock.disable_net_connect!(allow_localhost: true, allow: /codeclimate.com/)
32
+ CodeClimate::TestReporter.start
26
33
 
27
34
  # Use Webmock to route all requests to our Sinatra application `PseudoOrchestrateIo`.
28
35
  require_relative 'support/pseudo_orchestrate.io'
29
36
 
30
- # Keep the client from external requests.
31
- WebMock.disable_net_connect!(allow_localhost: true)
32
-
33
37
  RSpec.configure do |config|
34
38
  config.treat_symbols_as_metadata_keys_with_true_values = true
35
39
  config.run_all_when_everything_filtered = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestrate.io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - azukiwasher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -197,6 +197,7 @@ files:
197
197
  - lib/orchestrate.io/version.rb
198
198
  - orchestrate.io.gemspec
199
199
  - spec/orchestrate.io/client_spec.rb
200
+ - spec/orchestrate.io/core_ext/string_spec.rb
200
201
  - spec/orchestrate.io/events_spec.rb
201
202
  - spec/orchestrate.io/graph_spec.rb
202
203
  - spec/orchestrate.io/key_value_spec.rb
@@ -236,6 +237,7 @@ specification_version: 4
236
237
  summary: A Ruby wrapper for the Orchestrate.io API.
237
238
  test_files:
238
239
  - spec/orchestrate.io/client_spec.rb
240
+ - spec/orchestrate.io/core_ext/string_spec.rb
239
241
  - spec/orchestrate.io/events_spec.rb
240
242
  - spec/orchestrate.io/graph_spec.rb
241
243
  - spec/orchestrate.io/key_value_spec.rb