red5 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1bb49b333c808a9768fb5b486439fceeea835de9
4
+ data.tar.gz: 857af910f7b74427072ce7e42f724b603a53a02f
5
+ SHA512:
6
+ metadata.gz: 1efb5bcd4c275a23cafb8024993d32a91ce1bbcd0d66e7c31d97b0a82fe602db811ffa60bbd03be529acdfb119bb5700c4f74c24c52d634aca1645d900888b1c
7
+ data.tar.gz: 4121c9b5f99c01bea377039b48e7205d4bfcc3f84037b20d62ed18957a08841e50cad1e29f5839e81473bf5692e9670a0dd34dcae4d9a14b001a471d05d7e92a
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in red5.gemspec
4
+ gemspec
@@ -0,0 +1,61 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %(app lib config test spec feature)
6
+
7
+ ## Uncomment to clear the screen before every task
8
+ # clearing :on
9
+
10
+ # Note: The cmd option is now required due to the increasing number of ways
11
+ # rspec may be run, below are examples of the most common uses.
12
+ # * bundler: 'bundle exec rspec'
13
+ # * bundler binstubs: 'bin/rspec'
14
+ # * spring: 'bin/rspec' (This will use spring if running and you have
15
+ # installed the spring binstubs per the docs)
16
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
17
+ # * 'just' rspec: 'rspec'
18
+
19
+ guard :rspec, cmd: "bundle exec rspec" do
20
+ require "guard/rspec/dsl"
21
+ dsl = Guard::RSpec::Dsl.new(self)
22
+
23
+ # Feel free to open issues for suggestions and improvements
24
+
25
+ # RSpec files
26
+ rspec = dsl.rspec
27
+ watch(rspec.spec_helper) { rspec.spec_dir }
28
+ watch(rspec.spec_support) { rspec.spec_dir }
29
+ watch(rspec.spec_files)
30
+
31
+ # Ruby files
32
+ ruby = dsl.ruby
33
+ dsl.watch_spec_files_for(ruby.lib_files)
34
+
35
+ # Rails files
36
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
37
+ dsl.watch_spec_files_for(rails.app_files)
38
+ dsl.watch_spec_files_for(rails.views)
39
+
40
+ watch(rails.controllers) do |m|
41
+ [
42
+ rspec.spec.("routing/#{m[1]}_routing"),
43
+ rspec.spec.("controllers/#{m[1]}_controller"),
44
+ rspec.spec.("acceptance/#{m[1]}")
45
+ ]
46
+ end
47
+
48
+ # Rails config changes
49
+ watch(rails.spec_helper) { rspec.spec_dir }
50
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
51
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
52
+
53
+ # Capybara features specs
54
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
55
+
56
+ # Turnip features and steps
57
+ watch(%r{^spec/acceptance/(.+)\.feature$})
58
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
59
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
60
+ end
61
+ end
@@ -0,0 +1,22 @@
1
+ ##Copyright (c) 2013 Sam Pikesley
2
+
3
+ #MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # Red5
2
+
3
+ Ruby bindings for the [Star Wars API](http://swapi.co)
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task :default => [:spec]
@@ -0,0 +1,5 @@
1
+ require 'rest_client'
2
+ require 'json'
3
+
4
+ require 'red5/version'
5
+ require 'red5/planets'
@@ -0,0 +1,8 @@
1
+ module Red_5
2
+ class Planets
3
+ def self.find id
4
+ resource = RestClient::Resource.new "http://swapi.co/api/planets/#{id}"
5
+ JSON.parse resource.get.body
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module Red5
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'red5/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'red5'
8
+ spec.version = Red5::VERSION
9
+ spec.authors = ['pikesley']
10
+ spec.email = ['sam@pikesley.org']
11
+ spec.summary = %q{SWAPI bindings}
12
+ spec.description = %q{}
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'rest_client', '~> 1.8'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.7'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.1'
26
+ spec.add_development_dependency 'guard', '~> 2.10'
27
+ spec.add_development_dependency 'guard-rspec', '~> 4.5'
28
+ spec.add_development_dependency 'vcr', '~> 2.9'
29
+ spec.add_development_dependency 'webmock', '~> 1.18'
30
+ end
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/planets/2
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 301
19
+ message: MOVED PERMANENTLY
20
+ headers:
21
+ Date:
22
+ - Mon, 22 Dec 2014 15:49:11 GMT
23
+ Content-Type:
24
+ - text/html; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=d41800bf071d219779ee46187fc0064111419263350; expires=Tue, 22-Dec-15
31
+ 15:49:10 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ Location:
33
+ - http://swapi.co/api/planets/2/
34
+ X-Frame-Options:
35
+ - SAMEORIGIN
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cd77c6f87a0a78-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 15:49:11 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/planets/2/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Cookie:
59
+ - __cfduid=d41800bf071d219779ee46187fc0064111419263350; domain=.swapi.co
60
+ User-Agent:
61
+ - Ruby
62
+ response:
63
+ status:
64
+ code: 200
65
+ message: OK
66
+ headers:
67
+ Date:
68
+ - Mon, 22 Dec 2014 15:49:11 GMT
69
+ Content-Type:
70
+ - application/json
71
+ Transfer-Encoding:
72
+ - chunked
73
+ Connection:
74
+ - keep-alive
75
+ Vary:
76
+ - Accept, Cookie
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ Allow:
80
+ - GET, HEAD, OPTIONS
81
+ Via:
82
+ - 1.1 vegur
83
+ Server:
84
+ - cloudflare-nginx
85
+ Cf-Ray:
86
+ - 19cd77c928c90a78-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAAwAAAP//hJDdTsQgEIVfZcN1d4FuWyt3vsNeacxmLLNKQoHA
93
+ 1I0xvrtDN8aYuMoN5JyPMz/vIsCMwog7bzEDBNGIHAnIxXBMmF20bLYdyzE/
94
+ OQL/re6HKlvHAYSZBd32SrE0eTcD1VTCmfH6bsRzhldHb5XbFIJgIVuW+WsG
95
+ F1hmoBTPRmk2c1wCsVyYKEs+wYTHM1zKdLVGimnxa5u1P/V1avtYnMVARZgH
96
+ 8UKUjJTlDMntpij5kglj8ih7yfAf/jD+A4xaisdGnJyfr9ZaTamvJV3sYc2Z
97
+ MvKA67qV7ra63Wp10Nrse9ONu+7mlse75xy07ifWqkOrTD8azdi6ioot2TPz
98
+ W9HEO0YqspXi4xMAAP//AwAyBSB/AAIAAA==
99
+ http_version:
100
+ recorded_at: Mon, 22 Dec 2014 15:49:11 GMT
101
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ module Red_5
4
+ describe Planets do
5
+ it 'should find a planet', :vcr do
6
+ planet = Planets.find 2
7
+ expect(planet['name']).to eq 'Alderaan'
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ require 'red5'
2
+ require_relative 'support/vcr_setup'
3
+
4
+ RSpec.configure do |config|
5
+ config.expect_with :rspec do |expectations|
6
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
7
+ end
8
+
9
+ config.mock_with :rspec do |mocks|
10
+ mocks.verify_partial_doubles = true
11
+ end
12
+
13
+ config.filter_run :focus
14
+ config.run_all_when_everything_filtered = true
15
+ config.order = :random
16
+ end
@@ -0,0 +1,9 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/cassettes'
5
+ c.hook_into :webmock
6
+ c.default_cassette_options = { :record => :once }
7
+ c.allow_http_connections_when_no_cassette = true
8
+ c.configure_rspec_metadata!
9
+ end
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: red5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - pikesley
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest_client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.5'
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.9'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.18'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.18'
125
+ description: ''
126
+ email:
127
+ - sam@pikesley.org
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - Gemfile
135
+ - Guardfile
136
+ - LICENSE.md
137
+ - README.md
138
+ - Rakefile
139
+ - lib/red5.rb
140
+ - lib/red5/planets.rb
141
+ - lib/red5/version.rb
142
+ - red5.gemspec
143
+ - spec/cassettes/Red_5_Planets/should_find_a_planet.yml
144
+ - spec/red5_spec.rb
145
+ - spec/spec_helper.rb
146
+ - spec/support/vcr_setup.rb
147
+ homepage: ''
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 2.2.2
168
+ signing_key:
169
+ specification_version: 4
170
+ summary: SWAPI bindings
171
+ test_files:
172
+ - spec/cassettes/Red_5_Planets/should_find_a_planet.yml
173
+ - spec/red5_spec.rb
174
+ - spec/spec_helper.rb
175
+ - spec/support/vcr_setup.rb