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.
- data/.travis.yml +11 -0
- data/LICENSE.txt +15 -0
- data/README.md +10 -2
- data/Rakefile +11 -0
- data/lib/loaderio/configuration.rb +3 -6
- data/lib/loaderio/version.rb +1 -1
- data/loaderio.gemspec +1 -0
- data/spec/unit/loaderio/application_spec.rb +3 -1
- data/spec/unit/loaderio/configuration_spec.rb +2 -0
- data/spec/unit/loaderio/test_spec.rb +3 -1
- metadata +26 -2
data/.travis.yml
ADDED
data/LICENSE.txt
ADDED
@@ -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 [](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
@@ -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
|
-
|
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
|
data/lib/loaderio/version.rb
CHANGED
data/loaderio.gemspec
CHANGED
@@ -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){
|
7
|
+
let(:resource){ mock("resource") }
|
8
|
+
|
9
|
+
before{ Loaderio::Configuration.stub!(:resource).and_return(resource) }
|
8
10
|
|
9
11
|
subject{ application }
|
10
12
|
|
@@ -16,7 +16,9 @@ describe Loaderio::Test do
|
|
16
16
|
}
|
17
17
|
let(:test){ described_class.new attributes }
|
18
18
|
|
19
|
-
let(: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.
|
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-
|
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
|