typhoid 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.octopolo.yml +5 -0
- data/.ruby-version +1 -0
- data/.soyuz.yml +13 -0
- data/.travis.yml +2 -1
- data/CHANGELOG.markdown +5 -0
- data/README.md +17 -1
- data/lib/typhoid/parser.rb +1 -1
- data/lib/typhoid/version.rb +1 -1
- data/spec/spec_helper.rb +5 -1
- data/spec/typhoid/parser_spec.rb +6 -0
- data/spec/typhoid/resource_spec.rb +1 -1
- data/typhoid.gemspec +4 -0
- metadata +53 -23
- data/.rvmrc +0 -5
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NmNiYTBhODhmOGExODFhNjNhNjc4YzI5M2MzZDdkOWU1NzYwNDIxZg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NjY3Y2Y5NTRlYmQ4ZjQyNzU1MzZiYWFiN2U4NTQ2OTNmOTcwOWVjYw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTBmY2MzNjU3NjAxNWI2NjU4OGE1YTFjNGE1ZjBmNWIzZjY2MTRlMDYxMzhm
|
10
|
+
NDk4YzQ0NDhkM2VhOWRmZTc5OWJkYWNkY2NmMzZhYWU0ODllMjA0NTgzMzc0
|
11
|
+
MjYzOTRlNzYyN2VmNzEzMDY0MGFmMTIzNGVhN2UwZGM4MWU3NDU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZTk2MDc0NjZlNzViZTgwYTRlMTViNzRhYjY3YmQ2YjYxMTQ5MmQ4ZWI3MzZj
|
14
|
+
NDIwNTA1NzM5ZmM4MDBiMTlhY2Q1MDg3ZGEyYmNmZTNhMzE4ZDdlNDI2OTJl
|
15
|
+
ZmQxNTg0Y2M4MzhkNGM5N2FiMTFkZGYwOTE5NTE4MzA2MTRmNTY=
|
data/.octopolo.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/.soyuz.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
defaults:
|
2
|
+
deploy_cmd: gem push *.gem
|
3
|
+
before_deploy_cmds:
|
4
|
+
- /usr/local/bin/op tag-release
|
5
|
+
- sed -i "" -e "s/\".*/\"$(git tag | sed s/v// | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -1)\"/" lib/typhoid/version.rb
|
6
|
+
- git add lib/typhoid/version.rb
|
7
|
+
- git commit -m "Version Bump" && git push
|
8
|
+
- gem build typhoid.gemspec
|
9
|
+
after_deploy_cmds:
|
10
|
+
- rm *.gem
|
11
|
+
environments:
|
12
|
+
-
|
13
|
+
rubygems: {}
|
data/.travis.yml
CHANGED
data/CHANGELOG.markdown
ADDED
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
|
|
26
26
|
require 'typhoid'
|
27
27
|
|
28
28
|
class Game < Typhoid::Resource
|
29
|
-
field :id
|
29
|
+
field :id
|
30
30
|
field :team_1_name
|
31
31
|
field :team_2_name
|
32
32
|
field :start_time
|
@@ -40,6 +40,22 @@ class Game < Typhoid::Resource
|
|
40
40
|
end
|
41
41
|
```
|
42
42
|
|
43
|
+
A `field` creates a accessor methods that can be mass-assigned:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
g = Game.new id: 1, team_1_name: "Team 1", start_time: Time.now
|
47
|
+
|
48
|
+
g.id # => 1
|
49
|
+
g.team_1_name # => "Team 1"
|
50
|
+
g.team_2_name # => nil
|
51
|
+
g.start_time # => #<Time: ...>
|
52
|
+
|
53
|
+
g.team_2_name = "Team 2"
|
54
|
+
g.team_2_name # => "Team 2"
|
55
|
+
```
|
56
|
+
|
57
|
+
These fields will be set on request and will be
|
58
|
+
|
43
59
|
## Contributing
|
44
60
|
|
45
61
|
1. Fork it
|
data/lib/typhoid/parser.rb
CHANGED
data/lib/typhoid/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -6,8 +6,12 @@
|
|
6
6
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
7
|
|
8
8
|
require 'json'
|
9
|
+
require 'active_support'
|
10
|
+
require 'active_support/all'
|
11
|
+
require 'rspec/its'
|
12
|
+
require 'pry'
|
9
13
|
|
10
|
-
Dir["spec/support/**/*.rb"].each {|f| require "./#{f}"}
|
14
|
+
Dir["spec/support/**/*.rb"].each {|f| require "./#{f}"}
|
11
15
|
|
12
16
|
RSpec.configure do |config|
|
13
17
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
data/spec/typhoid/parser_spec.rb
CHANGED
@@ -30,6 +30,8 @@ module Typhoid
|
|
30
30
|
JSON
|
31
31
|
}
|
32
32
|
|
33
|
+
let(:empty_body) {""}
|
34
|
+
|
33
35
|
describe "class" do
|
34
36
|
subject { Parser }
|
35
37
|
|
@@ -53,6 +55,10 @@ module Typhoid
|
|
53
55
|
it "has an expected element" do
|
54
56
|
subject.parse["result"]["type"].should == "orphan"
|
55
57
|
end
|
58
|
+
|
59
|
+
it "has no body" do
|
60
|
+
expect{Parser.new(empty_body).parse}.to_not raise_error
|
61
|
+
end
|
56
62
|
end
|
57
63
|
end
|
58
64
|
end
|
@@ -152,7 +152,7 @@ describe Typhoid::Resource do
|
|
152
152
|
|
153
153
|
bad_game = controller.instance_variable_get("@game")
|
154
154
|
bad_game.team_1_name.should be_nil
|
155
|
-
bad_game.resource_exception.class.
|
155
|
+
expect(bad_game.resource_exception.class).to equal(Typhoid::ReadError)
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
data/typhoid.gemspec
CHANGED
@@ -13,11 +13,15 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "typhoid"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
+
gem.license = "MIT"
|
16
17
|
gem.version = Typhoid::VERSION
|
17
18
|
|
18
19
|
gem.add_dependency 'ffi'
|
19
20
|
gem.add_dependency 'typhoeus', "~> 0.4"
|
20
21
|
|
21
22
|
gem.add_development_dependency 'rspec'
|
23
|
+
gem.add_development_dependency 'rspec-rails'
|
24
|
+
gem.add_development_dependency 'rspec-its'
|
25
|
+
gem.add_development_dependency 'pry-rails'
|
22
26
|
gem.add_development_dependency 'json_pure', [">= 1.4.1"]
|
23
27
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typhoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Doug Rohde
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: ffi
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ! '>='
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ! '>='
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,7 +28,6 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: typhoeus
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ~>
|
37
33
|
- !ruby/object:Gem::Version
|
@@ -39,7 +35,6 @@ dependencies:
|
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
39
|
- - ~>
|
45
40
|
- !ruby/object:Gem::Version
|
@@ -47,7 +42,6 @@ dependencies:
|
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rspec
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
46
|
- - ! '>='
|
53
47
|
- !ruby/object:Gem::Version
|
@@ -55,7 +49,48 @@ dependencies:
|
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec-rails
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec-its
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: pry-rails
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
94
|
requirements:
|
60
95
|
- - ! '>='
|
61
96
|
- !ruby/object:Gem::Version
|
@@ -63,7 +98,6 @@ dependencies:
|
|
63
98
|
- !ruby/object:Gem::Dependency
|
64
99
|
name: json_pure
|
65
100
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
101
|
requirements:
|
68
102
|
- - ! '>='
|
69
103
|
- !ruby/object:Gem::Version
|
@@ -71,7 +105,6 @@ dependencies:
|
|
71
105
|
type: :development
|
72
106
|
prerelease: false
|
73
107
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
108
|
requirements:
|
76
109
|
- - ! '>='
|
77
110
|
- !ruby/object:Gem::Version
|
@@ -86,8 +119,11 @@ extra_rdoc_files: []
|
|
86
119
|
files:
|
87
120
|
- .gitignore
|
88
121
|
- .irbrc
|
89
|
-
- .
|
122
|
+
- .octopolo.yml
|
123
|
+
- .ruby-version
|
124
|
+
- .soyuz.yml
|
90
125
|
- .travis.yml
|
126
|
+
- CHANGELOG.markdown
|
91
127
|
- Gemfile
|
92
128
|
- LICENSE
|
93
129
|
- README.md
|
@@ -121,34 +157,28 @@ files:
|
|
121
157
|
- spec/typhoid/uri_spec.rb
|
122
158
|
- typhoid.gemspec
|
123
159
|
homepage: ''
|
124
|
-
licenses:
|
160
|
+
licenses:
|
161
|
+
- MIT
|
162
|
+
metadata: {}
|
125
163
|
post_install_message:
|
126
164
|
rdoc_options: []
|
127
165
|
require_paths:
|
128
166
|
- lib
|
129
167
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
168
|
requirements:
|
132
169
|
- - ! '>='
|
133
170
|
- !ruby/object:Gem::Version
|
134
171
|
version: '0'
|
135
|
-
segments:
|
136
|
-
- 0
|
137
|
-
hash: -4381647444060955036
|
138
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
-
none: false
|
140
173
|
requirements:
|
141
174
|
- - ! '>='
|
142
175
|
- !ruby/object:Gem::Version
|
143
176
|
version: '0'
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
hash: -4381647444060955036
|
147
177
|
requirements: []
|
148
178
|
rubyforge_project:
|
149
|
-
rubygems_version:
|
179
|
+
rubygems_version: 2.4.8
|
150
180
|
signing_key:
|
151
|
-
specification_version:
|
181
|
+
specification_version: 4
|
152
182
|
summary: A lightweight ORM-like wrapper around Typhoeus
|
153
183
|
test_files:
|
154
184
|
- spec/spec_helper.rb
|