loaderio 0.0.2 → 0.0.3

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.
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ before_install:
3
+ - gem install bundler
4
+ rvm:
5
+ - 1.9.2
6
+ - 1.9.3
7
+ notifications:
8
+ email: true
9
+ branches:
10
+ only:
11
+ - master
@@ -0,0 +1,15 @@
1
+ Copyright (c) 2012 SendGrid
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
5
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
6
+ and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of
9
+ the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
12
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
14
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
15
+ DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # ruby client for loader.io api
1
+ # ruby client for loader.io api [![Build Status](https://travis-ci.org/sendgridlabs/loaderio-ruby.png)](https://travis-ci.org/sendgridlabs/loaderio-ruby)
2
+
3
+ ## License
4
+ Licensed under the MIT License.
2
5
 
3
6
  ## Installing
4
7
 
@@ -58,9 +61,14 @@ Loaderio::Test.find("test_id")
58
61
  Loaderio::Test.create(url: "http://example.com", load: "0-10-10")
59
62
  => #<Loaderio::Test:0x007fd232131ee0>
60
63
  ```
64
+ #### Create test with tags
65
+ ```ruby
66
+ Loaderio::Test.create(url: "http://example.com", load: "0-10-10", tag_names: ["tag1", "tag2"])
67
+ => #<Loaderio::Test:0x007fd232131ee0>
68
+ ```
61
69
 
62
70
  ### Test results
63
71
  ```ruby
64
72
  Loaderio::Test.results("app_id")
65
73
  => #<Loaderio::Test:0x007fd2320eefc8>
66
- ```
74
+ ```
data/Rakefile CHANGED
@@ -1 +1,12 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require
5
+
6
+ require 'rspec/core/rake_task'
1
7
  require "bundler/gem_tasks"
8
+
9
+ RSpec::Core::RakeTask.new(:spec)
10
+
11
+ task :default => :spec
12
+
@@ -2,22 +2,19 @@ module Loaderio
2
2
  module Configuration
3
3
  extend self
4
4
 
5
- attr_accessor :api_key, :api_version, :protocol
5
+ attr_accessor :api_key, :api_version, :protocol, :server
6
6
 
7
7
  #default values
8
8
  self.api_version = "v1"
9
9
  self.protocol = "https"
10
-
11
- def server
12
- "api.loader.io"
13
- end
10
+ self.server = "api.loader.io"
14
11
 
15
12
  def base_url
16
13
  "#{protocol}://#{server}/#{api_version}"
17
14
  end
18
15
 
19
16
  def resource
20
- @resource ||= RestClient::Resource.new(base_url, headers: {"loaderio-Auth" => api_key, content_type: :json, accept: :json })
17
+ RestClient::Resource.new(base_url, headers: {"loaderio-Auth" => api_key, content_type: :json, accept: :json })
21
18
  end
22
19
  end
23
20
  end
@@ -1,3 +1,3 @@
1
1
  module Loaderio
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_development_dependency "rspec", "~> 2.12.0"
21
21
  s.add_development_dependency "simplecov", "~> 0.7.1"
22
+ s.add_development_dependency "rake", "~> 10.0.3"
22
23
 
23
24
  s.add_runtime_dependency "rest-client", "~> 1.6.7"
24
25
  s.add_runtime_dependency "oj", "~> 2.0.0"
@@ -4,7 +4,9 @@ describe Loaderio::Application do
4
4
  let(:attributes){ { app: "localhost.local", app_id: "fake-app-id", status: "verified" } }
5
5
  let(:application){ described_class.new(attributes) }
6
6
 
7
- let(:resource){ Loaderio::Configuration.resource }
7
+ let(:resource){ mock("resource") }
8
+
9
+ before{ Loaderio::Configuration.stub!(:resource).and_return(resource) }
8
10
 
9
11
  subject{ application }
10
12
 
@@ -24,6 +24,8 @@ describe Loaderio::Configuration do
24
24
  context "#server" do
25
25
  subject{ described_class.server }
26
26
 
27
+ before{ described_class.server = "api.loader.io" }
28
+
27
29
  it{ should == "api.loader.io" }
28
30
  end
29
31
 
@@ -16,7 +16,9 @@ describe Loaderio::Test do
16
16
  }
17
17
  let(:test){ described_class.new attributes }
18
18
 
19
- let(:resource){ Loaderio::Configuration.resource }
19
+ let(:resource){ mock("resource") }
20
+
21
+ before{ Loaderio::Configuration.stub!(:resource).and_return(resource) }
20
22
 
21
23
  subject{ test }
22
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loaderio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2012-12-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 0.7.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 10.0.3
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 10.0.3
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: rest-client
48
64
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +115,9 @@ extensions: []
99
115
  extra_rdoc_files: []
100
116
  files:
101
117
  - .gitignore
118
+ - .travis.yml
102
119
  - Gemfile
120
+ - LICENSE.txt
103
121
  - README.md
104
122
  - Rakefile
105
123
  - lib/loaderio.rb
@@ -126,12 +144,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
144
  - - ! '>='
127
145
  - !ruby/object:Gem::Version
128
146
  version: '0'
147
+ segments:
148
+ - 0
149
+ hash: -303001315850853445
129
150
  required_rubygems_version: !ruby/object:Gem::Requirement
130
151
  none: false
131
152
  requirements:
132
153
  - - ! '>='
133
154
  - !ruby/object:Gem::Version
134
155
  version: '0'
156
+ segments:
157
+ - 0
158
+ hash: -303001315850853445
135
159
  requirements: []
136
160
  rubyforge_project: loaderio
137
161
  rubygems_version: 1.8.23