spacex 0.0.1 → 0.0.3

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: adcc7d1a3eb88934e7932e8fb3d9098902ec5cbf
4
- data.tar.gz: d3fbf50819be10238d80518666b63fe442587083
3
+ metadata.gz: 4ba3a45b530329a81d7c8315a2ca0ce367cc070e
4
+ data.tar.gz: 7597627ee17df684f024969f4a52e50201287388
5
5
  SHA512:
6
- metadata.gz: 7c87ca7e9147366cb2668e0d3fc936718b4399061d07e2ab60f39a0b22f42f91540ce9e9234f91ca728ffce21aeb6785b150272cef50aef27ab07a49171de3e3
7
- data.tar.gz: 709f5220ed714de60a0ac3b2a607b93b7251a86e6bf4fb69b66986809a6ce02ed7e62435c137a57627743207c7766c662f8ba3641fe2565daa7c68cc4da3f931
6
+ metadata.gz: abe21113ddfa0d2eade7a3945dfb39c17ee99eb8b0a1eec1cf36206ea8a274babc65d87838ab7b67dd60504623d3cda2bca27ed84ee9921cf61a84b321291953
7
+ data.tar.gz: cd0c1698334c84c594931a1a36223a0d241187aa55f59103e181852b93babf9a36008c077f1977f27c8625222b45aa4877d12344d622fa379f7cec547696d9d6
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
51
+
52
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ Exclude:
3
+ - vendor/**/*
4
+
5
+ Naming/MethodName:
6
+ Enabled: false
7
+
8
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,36 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-08-20 14:17:26 -0400 using RuboCop version 0.51.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Lint/AmbiguousOperator:
11
+ Exclude:
12
+ - 'spec/spacex/launches_spec.rb'
13
+
14
+ # Offense count: 3
15
+ # Configuration parameters: CountComments, ExcludedMethods.
16
+ Metrics/BlockLength:
17
+ Max: 71
18
+
19
+ # Offense count: 24
20
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
21
+ # URISchemes: http, https
22
+ Metrics/LineLength:
23
+ Max: 150
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: CountComments.
27
+ Metrics/MethodLength:
28
+ Max: 12
29
+
30
+ # Offense count: 2
31
+ Style/Documentation:
32
+ Exclude:
33
+ - 'spec/**/*'
34
+ - 'test/**/*'
35
+ - 'lib/spacex/launches.rb'
36
+ - 'lib/spacex/version.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.1
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+
3
+ cache: bundler
4
+
5
+ rvm:
6
+ - 2.4.1
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'http://rubygems.org'
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Rodolfo Bandeira
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # SpaceX Ruby Client
2
+ Ruby library to consume SpaceX API
3
+
4
+ ---
5
+
6
+ ### Using:
7
+
8
+ ```ruby
9
+ latest_launch = SPACEX::Launches.latest
10
+
11
+ latest_launch.flight_number # 67
12
+ latest_launch.mission_name # 'Merah Putih'
13
+ latest_launch.launch_year # '2018'
14
+ latest_launch.launch_date_unix # 1_533_619_080
15
+ latest_launch.launch_date_utc # '2018-08-07T05:18:00.000Z'
16
+ latest_launch.launch_date_local # '2018-08-07T01:18:00-04:00'
17
+ latest_launch.launch_success # true
18
+ latest_launch.rocket.rocket_id # 'falcon9'
19
+ latest_launch.rocket.rocket_name # 'Falcon 9'
20
+ latest_launch.rocket.rocket_type # 'FT'
21
+ latest_launch.rocket.first_stage.cores.first.core_serial # 'B1046'
22
+ latest_launch.rocket.first_stage.cores.first.flight # 2
23
+ latest_launch.rocket.first_stage.cores.first.block # 5
24
+ latest_launch.rocket.first_stage.cores.first.reused # true
25
+ latest_launch.rocket.first_stage.cores.first.land_success # true
26
+ latest_launch.rocket.first_stage.cores.first.landing_type # 'ASDS'
27
+ latest_launch.rocket.first_stage.cores.first.landing_vehicle # 'OCISLY'
28
+ latest_launch.rocket.second_stage.block # 5
29
+ latest_launch.rocket.second_stage.payloads.first.payload_id # 'Telkom-4'
30
+ latest_launch.rocket.second_stage.payloads.first.norad_id.first # 43_587
31
+ latest_launch.rocket.second_stage.payloads.first.reused # false
32
+ latest_launch.rocket.second_stage.payloads.first.customers.first # 'Telkom'
33
+ latest_launch.rocket.second_stage.payloads.first.nationality # 'Indonesia'
34
+ latest_launch.rocket.second_stage.payloads.first.manufacturer # 'SSL'
35
+ latest_launch.rocket.second_stage.payloads.first.payload_type # 'Satellite'
36
+ latest_launch.rocket.second_stage.payloads.first.payload_mass_kg # 5800
37
+ latest_launch.rocket.second_stage.payloads.first.payload_mass_lbs # 12_786.81
38
+ latest_launch.rocket.second_stage.payloads.first.orbit # 'GTO'
39
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.reference_system # 'geocentric'
40
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.regime # 'geostationary'
41
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.longitude # -108
42
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.semi_major_axis_km # 21_226.178
43
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.eccentricity # 0.6904141
44
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.periapsis_km # 193.19
45
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.apoapsis_km # 29_502.896
46
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.inclination_deg # 27.0648
47
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.period_min # 512.941
48
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.lifespan_years # 15
49
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.epoch # '2018-08-07T06:57:16.000Z'
50
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.mean_motion # 2.80734018
51
+ latest_launch.rocket.second_stage.payloads.first.orbit_params.raan # 227.0228
52
+ latest_launch.telemetry.flight_club # nil
53
+ latest_launch.reuse.core # true
54
+ latest_launch.reuse.sire_core1 # nil
55
+ latest_launch.reuse.side_core2 # false
56
+ latest_launch.reuse.fairings # false
57
+ latest_launch.reuse.capsule # false
58
+ latest_launch.launch_site.site_id # 'ccafs_slc_40'
59
+ latest_launch.launch_site.site_name # 'CCAFS SLC 40'
60
+ latest_launch.launch_site.site_name_long # 'Cape Canaveral Air Force Station Space Launch Complex 40'
61
+ latest_launch.launch_success # true
62
+ latest_launch.links.mission_patch # 'https://images2.imgbox.com/a8/f5/ZgdsrbqW_o.png'
63
+ latest_launch.links.mision_patch_small # nil
64
+ latest_launch.links.reddit_campaign # 'https://www.reddit.com/r/spacex/comments/91gwfg/merah_putih_telkom4_launch_campaign_thread/'
65
+ latest_launch.links.reddit_launch # 'https://www.reddit.com/r/spacex/comments/9539nr/rspacex_merah_putih_telkom4_official_launch/'
66
+ latest_launch.links.reddit_recovery # nil
67
+ latest_launch.links.reddit_media # 'https://www.reddit.com/r/spacex/comments/94zr0b/rspacex_merah_putih_media_thread_videos_images/'
68
+ latest_launch.links.presskit # 'https://www.spacex.com/sites/spacex/files/merahputihpresskit.pdf'
69
+ latest_launch.links.article_link # 'https://spaceflightnow.com/2018/08/07/indonesian-communications-satellite-deployed-in-orbit-by-spacex/'
70
+ latest_launch.links.wikipedia # 'https://en.wikipedia.org/wiki/Telkom_Indonesia'
71
+ latest_launch.links.video_link # 'https://www.youtube.com/watch?v=FjfQNBYv2IY'
72
+ latest_launch.details # 'Indonesian comsat intended to replace the aging Telkom 1 at 108° E. First reflight of a Block 5-version booster.'
73
+ latest_launch.upcoming # false
74
+ latest_launch.static_fire_date_utc # '2018-08-02T15:53:00.000Z'
75
+ ```
76
+
data/Rakefile ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ require 'bundler/gem_tasks'
6
+
7
+ Bundler.setup :default, :development
8
+
9
+ require 'rspec/core'
10
+ require 'rspec/core/rake_task'
11
+
12
+ RSpec::Core::RakeTask.new(:spec) do |spec|
13
+ spec.pattern = FileList['spec/**/*_spec.rb']
14
+ end
15
+
16
+ require 'rubocop/rake_task'
17
+ RuboCop::RakeTask.new
18
+
19
+ task default: %i[rubocop spec]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SPACEX
4
+ ENDPOINT = 'https://api.spacexdata.com/v2/'
5
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ostruct'
4
+
5
+ module SPACEX
6
+ module Launches
7
+ ROOT_URI = 'https://api.spacexdata.com/v2'
8
+
9
+ def self.latest
10
+ path = 'launches/latest'
11
+
12
+ data = Faraday.new(
13
+ url: "#{ROOT_URI}/#{path}",
14
+ request: {
15
+ params_encoder: Faraday::FlatParamsEncoder
16
+ }
17
+ ) do |c|
18
+ c.use ::FaradayMiddleware::ParseJson
19
+ c.use Faraday::Response::RaiseError
20
+ c.use Faraday::Adapter::NetHttp
21
+ end
22
+ Hashie::Mash.new(data.get.body)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SPACEX
4
+ VERSION = '0.0.3'
5
+
6
+ def self.help
7
+ puts 'https://github.com/rodolfobandeira/spacex'
8
+ end
9
+ end
data/lib/spacex.rb CHANGED
@@ -1,5 +1,9 @@
1
- class Spacex
2
- def self.help
3
- puts 'https://github.com/rodolfobandeira/spacex'
4
- end
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require 'faraday_middleware'
5
+ require 'faraday_middleware/response_middleware'
6
+ require 'hashie'
7
+
8
+ require_relative 'spacex/version'
9
+ require_relative 'spacex/launches'
data/rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ AllCops:
2
+ Exclude:
3
+ - vendor/**/*
4
+
5
+ Naming/MethodName:
6
+ Enabled: false
7
+
8
+ inherit_from: .rubocop_todo.yml
data/spacex.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
+ require 'spacex/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'spacex'
6
+ s.bindir = 'bin'
7
+ s.version = SPACEX::VERSION
8
+ s.date = '2018-08-17'
9
+ s.summary = 'Swap SpaceX API with Ruby'
10
+ s.description = 'Ruby library to consume SpaceX launch data'
11
+ s.authors = ['Rodolfo Bandeira']
12
+ s.email = 'rodolfobandeira@protonmail.com'
13
+ s.platform = Gem::Platform::RUBY
14
+ s.homepage = 'https://github.com/rodolfobandeira/spacex'
15
+ s.license = 'MIT'
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- spec/*`.split("\n")
18
+ s.require_paths = ['lib']
19
+ s.add_dependency 'faraday', '>= 0.9'
20
+ s.add_dependency 'faraday_middleware'
21
+ s.add_dependency 'hashie'
22
+ s.add_development_dependency 'rake', '~> 10'
23
+ s.add_development_dependency 'rspec'
24
+ s.add_development_dependency 'rubocop', '0.51.0'
25
+ s.add_development_dependency 'vcr'
26
+ s.add_development_dependency 'webmock'
27
+ end
@@ -0,0 +1,245 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.spacexdata.com/v2/launches/latest
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.2
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sat, 18 Aug 2018 19:45:17 GMT
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=d167cc1a95462b768a646d294361640131534621517; expires=Sun, 18-Aug-19
31
+ 19:45:17 GMT; path=/; domain=.spacexdata.com; HttpOnly; Secure
32
+ Vary:
33
+ - Accept-Encoding, Origin
34
+ X-Dns-Prefetch-Control:
35
+ - 'off'
36
+ X-Frame-Options:
37
+ - SAMEORIGIN
38
+ Strict-Transport-Security:
39
+ - max-age=15552000; includeSubDomains
40
+ X-Download-Options:
41
+ - noopen
42
+ X-Content-Type-Options:
43
+ - nosniff
44
+ X-Xss-Protection:
45
+ - 1; mode=block
46
+ Access-Control-Allow-Origin:
47
+ - "*"
48
+ X-Response-Time:
49
+ - 43ms
50
+ Expect-Ct:
51
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
52
+ Server:
53
+ - cloudflare
54
+ Cf-Ray:
55
+ - 44c6e1419d4f9f05-ORD
56
+ body:
57
+ encoding: ASCII-8BIT
58
+ string: !binary |-
59
+ eyJmbGlnaHRfbnVtYmVyIjo2NywibWlzc2lvbl9uYW1lIjoiTWVyYWggUHV0aWgiLCJsYXVuY2hfeWVhciI6IjIwMTgiLCJsYXVuY2hfZGF0ZV91bml4IjoxNTMzNjE5MDgwLCJsYXV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InJlZGRpdF9tZWRpYSI6Imh0dHBzOi8vd3d3LnJlZGRpdC5jb20vci9zcGFjZXgvY29tbWVudHMvOTR6cjBiL3JzcGFjZXhfbWVyYWhfcHV0aWhfbWVkaWFfdGhyZWFkX3ZpZGVvc19pbWFnZXMvIiwicHJlc3NraXQiOiJodHRwczovL3d3dy5zcGFjZXguY29tL3NpdGVzL3NwYWNleC9maWxlcy9tZXJhaHB1dGlocHJlc3NraXQucGRmIiwiYXJ0aWNsZV9saW5rIjoiaHR0cHM6Ly9zcGFjZWZsaWdodG5vdy5jb20vMjAxOC8wOC8wNy9pbmRvbmVzaWFuLWNvbW11bmljYXRpb25zLXNhdGVsbGl0ZS1kZXBsb3llZC1pbi1vcmJpdC1ieS1zcGFjZXgvIiwid2lraXBlZGlhIjoiaHR0cHM6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvVGVsa29tX0luZG9uZXNpYSIsInZpZGVvX2xpbmsiOiJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PUZqZlFOQll2MklZIn0sImRldGFpbHMiOiJJbmRvbmVzaWFuIGNvbXNhdCBpbnRlbmRlZCB0byByZXBsYWNlIHRoZSBhZ2luZyBUZWxrb20gMSBhdCAxMDjCsCBFLiBGaXJzdCByZWZsaWdodCBvZiBhIEJsb2NrIDUtdmVyc2lvbiBib29zdGVyLiIsInVwY29taW5nIjpmYWxzZSwic3RhdGljX2ZpcmVfZGF0ZV91dGMiOiIyMDE4LTA4LTAyVDE1OjUzOjAwLjAwMFoifQ==
60
+ http_version:
61
+ recorded_at: Sat, 18 Aug 2018 19:45:17 GMT
62
+ - request:
63
+ method: get
64
+ uri: https://api.spacexdata.com/v2/launches/latest
65
+ body:
66
+ encoding: US-ASCII
67
+ string: ''
68
+ headers:
69
+ User-Agent:
70
+ - Faraday v0.15.2
71
+ Accept-Encoding:
72
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
73
+ Accept:
74
+ - "*/*"
75
+ response:
76
+ status:
77
+ code: 200
78
+ message: OK
79
+ headers:
80
+ Date:
81
+ - Sat, 18 Aug 2018 19:45:26 GMT
82
+ Content-Type:
83
+ - application/json; charset=utf-8
84
+ Transfer-Encoding:
85
+ - chunked
86
+ Connection:
87
+ - keep-alive
88
+ Set-Cookie:
89
+ - __cfduid=d1410ba111f548dfb99b1d8ad2cb574981534621526; expires=Sun, 18-Aug-19
90
+ 19:45:26 GMT; path=/; domain=.spacexdata.com; HttpOnly; Secure
91
+ Vary:
92
+ - Accept-Encoding, Origin
93
+ X-Dns-Prefetch-Control:
94
+ - 'off'
95
+ X-Frame-Options:
96
+ - SAMEORIGIN
97
+ Strict-Transport-Security:
98
+ - max-age=15552000; includeSubDomains
99
+ X-Download-Options:
100
+ - noopen
101
+ X-Content-Type-Options:
102
+ - nosniff
103
+ X-Xss-Protection:
104
+ - 1; mode=block
105
+ Access-Control-Allow-Origin:
106
+ - "*"
107
+ X-Koa-Redis-Cache:
108
+ - 'true'
109
+ X-Response-Time:
110
+ - 1ms
111
+ Expect-Ct:
112
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
113
+ Server:
114
+ - cloudflare
115
+ Cf-Ray:
116
+ - 44c6e17cde272525-ORD
117
+ body:
118
+ encoding: ASCII-8BIT
119
+ string: !binary |-
120
+ eyJmbGlnaHRfbnVtYmVyIjo2NywibWlzc2lvbl9uYW1lIjoiTWVyYWggUHV0aWgiLCJsYXVuY2hfeWVhciI6IjIwMTgiLCJsYXVuY2hfZGF0ZV91bml4IjoxNTMzNjE5MDgwLCJsYXVuY2hfZGF0ZV91dGMiOiIyMDE4LTA4LTA3VDA1OjE4OjAwLjAwMFoiLCJsYXVuY2hfZGF0ZV9sb2NhbCI6IjIwMTgtMDgtMDdUMDE6MTg6MDAtMDQ6MDAiLCJyb2NrZXQiOnsicm9ja2V0X2lkIjoiZmFsY29uOSIsInJvY2tldF9uYW1lIjoiRmFsY29uIDkiLCJyb2NrZXRfdHlwZSI6I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XJhaHB1dGlocHJlc3NraXQucGRmIiwiYXJ0aWNsZV9saW5rIjoiaHR0cHM6Ly9zcGFjZWZsaWdodG5vdy5jb20vMjAxOC8wOC8wNy9pbmRvbmVzaWFuLWNvbW11bmljYXRpb25zLXNhdGVsbGl0ZS1kZXBsb3llZC1pbi1vcmJpdC1ieS1zcGFjZXgvIiwid2lraXBlZGlhIjoiaHR0cHM6Ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvVGVsa29tX0luZG9uZXNpYSIsInZpZGVvX2xpbmsiOiJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PUZqZlFOQll2MklZIn0sImRldGFpbHMiOiJJbmRvbmVzaWFuIGNvbXNhdCBpbnRlbmRlZCB0byByZXBsYWNlIHRoZSBhZ2luZyBUZWxrb20gMSBhdCAxMDjCsCBFLiBGaXJzdCByZWZsaWdodCBvZiBhIEJsb2NrIDUtdmVyc2lvbiBib29zdGVyLiIsInVwY29taW5nIjpmYWxzZSwic3RhdGljX2ZpcmVfZGF0ZV91dGMiOiIyMDE4LTA4LTAyVDE1OjUzOjAwLjAwMFoifQ==
121
+ http_version:
122
+ recorded_at: Sat, 18 Aug 2018 19:45:26 GMT
123
+ - request:
124
+ method: get
125
+ uri: https://api.spacexdata.com/v2/launches/latest
126
+ body:
127
+ encoding: US-ASCII
128
+ string: ''
129
+ headers:
130
+ User-Agent:
131
+ - Faraday v0.15.2
132
+ Accept-Encoding:
133
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
134
+ Accept:
135
+ - "*/*"
136
+ response:
137
+ status:
138
+ code: 200
139
+ message: OK
140
+ headers:
141
+ Date:
142
+ - Sat, 18 Aug 2018 19:45:32 GMT
143
+ Content-Type:
144
+ - application/json; charset=utf-8
145
+ Transfer-Encoding:
146
+ - chunked
147
+ Connection:
148
+ - keep-alive
149
+ Set-Cookie:
150
+ - __cfduid=d95522303e13c2945bff877ae1fce4d1b1534621532; expires=Sun, 18-Aug-19
151
+ 19:45:32 GMT; path=/; domain=.spacexdata.com; HttpOnly; Secure
152
+ Vary:
153
+ - Accept-Encoding, Origin
154
+ X-Dns-Prefetch-Control:
155
+ - 'off'
156
+ X-Frame-Options:
157
+ - SAMEORIGIN
158
+ Strict-Transport-Security:
159
+ - max-age=15552000; includeSubDomains
160
+ X-Download-Options:
161
+ - noopen
162
+ X-Content-Type-Options:
163
+ - nosniff
164
+ X-Xss-Protection:
165
+ - 1; mode=block
166
+ Access-Control-Allow-Origin:
167
+ - "*"
168
+ X-Koa-Redis-Cache:
169
+ - 'true'
170
+ X-Response-Time:
171
+ - 1ms
172
+ Expect-Ct:
173
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
174
+ Server:
175
+ - cloudflare
176
+ Cf-Ray:
177
+ - 44c6e1a21bfe55c4-ORD
178
+ body:
179
+ encoding: ASCII-8BIT
180
+ string: !binary |-
181
+ eyJmbGlnaHRfbnVtYmVyIjo2NywibWlzc2lvbl9uYW1lIjoiTWVyYWggUHV0aWgiLCJsYXVuY2hfeWVhciI6IjIwMTgiLCJsYXVuY2hfZGF0ZV91bml4IjoxNTMzNjE5MDgwLCJsYXVuY2hfZGF0ZV91dGMiOiIyMDE4LTA4LTA3VDA1OjE4OjAwLjAwMFoiLCJsYXVuY2hfZGF0ZV9sb2NhbCI6IjIwMTgtMDgtMDdUMDE6MTg6MDAtMDQ6MDAiLCJyb2NrZXQiOnsicm9ja2V0X2lkIjoiZmFsY29uOSIsInJvY2tldF9uYW1lIjoiRmFsY29uIDkiLCJyb2NrZXRfdHlwZSI6IkZUIiwiZmlyc3Rfc3RhZ2UiOnsiY29yZXMiOlt7ImNvcmVfc2VyaWFsIjoiQjEwNDYiLCJmbGlnaHQiOjIsImJsb2NrIjo1LCJyZXVzZWQiOnRydWUsImxhbmRfc3VjY2VzcyI6dHJ1ZSwibGFuZGluZ190eXBlIjoiQVNEUyIsImxhbmRpbmdfdmVoaWNsZSI6Ik9DSVNMWSJ9XX0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ly9lbi53aWtpcGVkaWEub3JnL3dpa2kvVGVsa29tX0luZG9uZXNpYSIsInZpZGVvX2xpbmsiOiJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PUZqZlFOQll2MklZIn0sImRldGFpbHMiOiJJbmRvbmVzaWFuIGNvbXNhdCBpbnRlbmRlZCB0byByZXBsYWNlIHRoZSBhZ2luZyBUZWxrb20gMSBhdCAxMDjCsCBFLiBGaXJzdCByZWZsaWdodCBvZiBhIEJsb2NrIDUtdmVyc2lvbiBib29zdGVyLiIsInVwY29taW5nIjpmYWxzZSwic3RhdGljX2ZpcmVfZGF0ZV91dGMiOiIyMDE4LTA4LTAyVDE1OjUzOjAwLjAwMFoifQ==
182
+ http_version:
183
+ recorded_at: Sat, 18 Aug 2018 19:45:32 GMT
184
+ - request:
185
+ method: get
186
+ uri: https://api.spacexdata.com/v2/launches/latest
187
+ body:
188
+ encoding: US-ASCII
189
+ string: ''
190
+ headers:
191
+ User-Agent:
192
+ - Faraday v0.15.2
193
+ Accept-Encoding:
194
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
195
+ Accept:
196
+ - "*/*"
197
+ response:
198
+ status:
199
+ code: 200
200
+ message: OK
201
+ headers:
202
+ Date:
203
+ - Sat, 18 Aug 2018 19:45:37 GMT
204
+ Content-Type:
205
+ - application/json; charset=utf-8
206
+ Transfer-Encoding:
207
+ - chunked
208
+ Connection:
209
+ - keep-alive
210
+ Set-Cookie:
211
+ - __cfduid=dbfcf3a9e04620923b3bf6f29d51ebf3e1534621537; expires=Sun, 18-Aug-19
212
+ 19:45:37 GMT; path=/; domain=.spacexdata.com; HttpOnly; Secure
213
+ Vary:
214
+ - Accept-Encoding, Origin
215
+ X-Dns-Prefetch-Control:
216
+ - 'off'
217
+ X-Frame-Options:
218
+ - SAMEORIGIN
219
+ Strict-Transport-Security:
220
+ - max-age=15552000; includeSubDomains
221
+ X-Download-Options:
222
+ - noopen
223
+ X-Content-Type-Options:
224
+ - nosniff
225
+ X-Xss-Protection:
226
+ - 1; mode=block
227
+ Access-Control-Allow-Origin:
228
+ - "*"
229
+ X-Koa-Redis-Cache:
230
+ - 'true'
231
+ X-Response-Time:
232
+ - 2ms
233
+ Expect-Ct:
234
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
235
+ Server:
236
+ - cloudflare
237
+ Cf-Ray:
238
+ - 44c6e1c39f225528-ORD
239
+ body:
240
+ encoding: ASCII-8BIT
241
+ string: !binary |-
242
+ eyJmbGlnaHRfbnVtYmVyIjo2NywibWlzc2lvbl9uYW1lIjoiTWVyYWggUHV0aWgiLCJsYXVuY2hfeWVhciI6IjIwMTgiLCJsYXVuY2hfZGF0ZV91bml4IjoxNTMzNjE5MDgwLCJsYXVuY2hfZGF0ZV91dGMiOiIyMDE4LTA4LTA3VDA1OjE4OjAwLjAwMFoiLCJsYXVuY2hfZGF0ZV9sb2NhbCI6IjIwMTgtMDgtMDdUMDE6MTg6MDAtMDQ6MDAiLCJyb2NrZXQiOnsicm9ja2V0X2lkIjoiZmFsY29uOSIsInJvY2tldF9uYW1lIjoiRmFsY29uIDkiLCJyb2NrZXRfdHlwZSI6IkZUIiwiZmlyc3Rfc3RhZ2UiOnsiY29yZXMiOlt7ImNvcmVfc2VyaWFsIjoiQjEwNDYiLCJmbGlnaHQiOjIsImJsb2NrIjo1LCJyZXVzZWQiOnRydWUsImxhbmRfc3VjY2VzcyI6dHJ1ZSwibGFuZGluZ190eXBlIjoiQVNEUyIsImxhbmRpbmdfdmVoaWNsZSI6Ik9DSVNMWSJ9XX0sInNlY29uZF9zdGFnZSI6eyJibG9jayI6NSwicGF5bG9hZHMiOlt7InBheWxvYWRfaWQiOiJUZWxrb20tNCIsIm5vcmFkX2lkIjpbNDM1ODddLCJyZXVzZWQiOmZhbHNlLCJjdXN0b21lcnMiOlsiVGVsa29tIl0sIm5hdGlvbmFsaXR5IjoiSW5kb25lc2lhIiwibWFudWZhY3R1cmVyIjoiU1N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SBhdCAxMDjCsCBFLiBGaXJzdCByZWZsaWdodCBvZiBhIEJsb2NrIDUtdmVyc2lvbiBib29zdGVyLiIsInVwY29taW5nIjpmYWxzZSwic3RhdGljX2ZpcmVfZGF0ZV91dGMiOiIyMDE4LTA4LTAyVDE1OjUzOjAwLjAwMFoifQ==
243
+ http_version:
244
+ recorded_at: Sat, 18 Aug 2018 19:45:37 GMT
245
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe SPACEX do
6
+ context 'Launches', vcr: { cassette_name: 'launches/latest' } do
7
+ subject do
8
+ SPACEX::Launches.latest
9
+ end
10
+ it 'returns latest launch' do
11
+ expect(subject.flight_number).to eq 67
12
+ expect(subject.mission_name).to eq 'Merah Putih'
13
+ expect(subject.launch_year).to eq '2018'
14
+ expect(subject.launch_date_unix).to eq 1_533_619_080
15
+ expect(subject.launch_date_utc).to eq '2018-08-07T05:18:00.000Z'
16
+ expect(subject.launch_date_local).to eq '2018-08-07T01:18:00-04:00'
17
+ expect(subject.launch_success).to eq true
18
+
19
+ expect(subject.rocket.rocket_id).to eq 'falcon9'
20
+ expect(subject.rocket.rocket_name).to eq 'Falcon 9'
21
+ expect(subject.rocket.rocket_type).to eq 'FT'
22
+
23
+ expect(subject.rocket.first_stage.cores.first.core_serial).to eq 'B1046'
24
+ expect(subject.rocket.first_stage.cores.first.flight).to eq 2
25
+ expect(subject.rocket.first_stage.cores.first.block).to eq 5
26
+ expect(subject.rocket.first_stage.cores.first.reused).to eq true
27
+ expect(subject.rocket.first_stage.cores.first.land_success).to eq true
28
+ expect(subject.rocket.first_stage.cores.first.landing_type).to eq 'ASDS'
29
+ expect(subject.rocket.first_stage.cores.first.landing_vehicle).to eq 'OCISLY'
30
+
31
+ expect(subject.rocket.second_stage.block).to eq 5
32
+
33
+ expect(subject.rocket.second_stage.payloads.first.payload_id).to eq 'Telkom-4'
34
+ expect(subject.rocket.second_stage.payloads.first.norad_id.first).to eq 43_587
35
+ expect(subject.rocket.second_stage.payloads.first.reused).to eq false
36
+ expect(subject.rocket.second_stage.payloads.first.customers.first).to eq 'Telkom'
37
+ expect(subject.rocket.second_stage.payloads.first.nationality).to eq 'Indonesia'
38
+ expect(subject.rocket.second_stage.payloads.first.manufacturer).to eq 'SSL'
39
+ expect(subject.rocket.second_stage.payloads.first.payload_type).to eq 'Satellite'
40
+ expect(subject.rocket.second_stage.payloads.first.payload_mass_kg).to eq 5800
41
+ expect(subject.rocket.second_stage.payloads.first.payload_mass_lbs).to eq 12_786.81
42
+ expect(subject.rocket.second_stage.payloads.first.orbit).to eq 'GTO'
43
+
44
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.reference_system).to eq 'geocentric'
45
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.regime).to eq 'geostationary'
46
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.longitude).to eq -108
47
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.semi_major_axis_km).to eq 21_226.178
48
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.eccentricity).to eq 0.6904141
49
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.periapsis_km).to eq 193.19
50
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.apoapsis_km).to eq 29_502.896
51
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.inclination_deg).to eq 27.0648
52
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.period_min).to eq 512.941
53
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.lifespan_years).to eq 15
54
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.epoch).to eq '2018-08-07T06:57:16.000Z'
55
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.mean_motion).to eq 2.80734018
56
+ expect(subject.rocket.second_stage.payloads.first.orbit_params.raan).to eq 227.0228
57
+
58
+ expect(subject.telemetry.flight_club).to eq nil
59
+ expect(subject.reuse.core).to eq true
60
+ expect(subject.reuse.sire_core1).to eq nil
61
+ expect(subject.reuse.side_core2).to eq false
62
+ expect(subject.reuse.fairings).to eq false
63
+ expect(subject.reuse.capsule).to eq false
64
+
65
+ expect(subject.launch_site.site_id).to eq 'ccafs_slc_40'
66
+ expect(subject.launch_site.site_name).to eq 'CCAFS SLC 40'
67
+ expect(subject.launch_site.site_name_long).to eq 'Cape Canaveral Air Force Station Space Launch Complex 40'
68
+
69
+ expect(subject.launch_success).to eq true
70
+
71
+ expect(subject.links.mission_patch).to eq 'https://images2.imgbox.com/a8/f5/ZgdsrbqW_o.png'
72
+ expect(subject.links.mision_patch_small).to eq nil
73
+ expect(subject.links.reddit_campaign).to eq 'https://www.reddit.com/r/spacex/comments/91gwfg/merah_putih_telkom4_launch_campaign_thread/'
74
+ expect(subject.links.reddit_launch).to eq 'https://www.reddit.com/r/spacex/comments/9539nr/rspacex_merah_putih_telkom4_official_launch/'
75
+ expect(subject.links.reddit_recovery).to eq nil
76
+ expect(subject.links.reddit_media).to eq 'https://www.reddit.com/r/spacex/comments/94zr0b/rspacex_merah_putih_media_thread_videos_images/'
77
+ expect(subject.links.presskit).to eq 'https://www.spacex.com/sites/spacex/files/merahputihpresskit.pdf'
78
+ expect(subject.links.article_link).to eq 'https://spaceflightnow.com/2018/08/07/indonesian-communications-satellite-deployed-in-orbit-by-spacex/'
79
+ expect(subject.links.wikipedia).to eq 'https://en.wikipedia.org/wiki/Telkom_Indonesia'
80
+ expect(subject.links.video_link).to eq 'https://www.youtube.com/watch?v=FjfQNBYv2IY'
81
+
82
+ expect(subject.details).to eq 'Indonesian comsat intended to replace the aging Telkom 1 at 108° E. First reflight of a Block 5-version booster.'
83
+ expect(subject.upcoming).to eq false
84
+ expect(subject.static_fire_date_utc).to eq '2018-08-02T15:53:00.000Z'
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe SPACEX do
6
+ it 'has a version' do
7
+ expect(SPACEX::VERSION).to_not be nil
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
4
+
5
+ require 'rubygems'
6
+ require 'rspec'
7
+ require 'spacex'
8
+
9
+ Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each do |file|
10
+ require file
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'vcr'
4
+ require 'webmock/rspec'
5
+
6
+ VCR.configure do |config|
7
+ config.cassette_library_dir = 'spec/fixtures/spacex'
8
+ config.hook_into :webmock
9
+ # config.default_cassette_options = { record: :new_episodes }
10
+ config.configure_rspec_metadata!
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spacex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodolfo Bandeira
@@ -9,15 +9,147 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-08-17 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hashie
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.51.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.51.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
13
125
  description: Ruby library to consume SpaceX launch data
14
126
  email: rodolfobandeira@protonmail.com
15
127
  executables: []
16
128
  extensions: []
17
129
  extra_rdoc_files: []
18
130
  files:
131
+ - ".gitignore"
132
+ - ".rspec"
133
+ - ".rubocop.yml"
134
+ - ".rubocop_todo.yml"
135
+ - ".ruby-version"
136
+ - ".travis.yml"
137
+ - Gemfile
138
+ - LICENSE
139
+ - README.md
140
+ - Rakefile
19
141
  - lib/spacex.rb
20
- homepage: http://rubygems.org/gems/spacex
142
+ - lib/spacex/endpoint.rb
143
+ - lib/spacex/launches.rb
144
+ - lib/spacex/version.rb
145
+ - rubocop.yml
146
+ - spacex.gemspec
147
+ - spec/fixtures/spacex/launches/latest.yml
148
+ - spec/spacex/launches_spec.rb
149
+ - spec/spacex/version_spec.rb
150
+ - spec/spec_helper.rb
151
+ - spec/support/vcr.rb
152
+ homepage: https://github.com/rodolfobandeira/spacex
21
153
  licenses:
22
154
  - MIT
23
155
  metadata: {}
@@ -41,4 +173,9 @@ rubygems_version: 2.6.11
41
173
  signing_key:
42
174
  specification_version: 4
43
175
  summary: Swap SpaceX API with Ruby
44
- test_files: []
176
+ test_files:
177
+ - spec/fixtures/spacex/launches/latest.yml
178
+ - spec/spacex/launches_spec.rb
179
+ - spec/spacex/version_spec.rb
180
+ - spec/spec_helper.rb
181
+ - spec/support/vcr.rb