mars_weather 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d647e3d801f297f3e0deb391c932fe410e038a77
4
- data.tar.gz: 7fba888b03afb1b4434f2615a4d59297cbf7fad2
3
+ metadata.gz: 69815e41a73a81e79330b5d127a4fdd7040fe434
4
+ data.tar.gz: e269f93931871e7a067b789cecd5d0a30c01a26e
5
5
  SHA512:
6
- metadata.gz: c2f0da7b95c17b7d9c2ccb164b9176ba65f98b5ded966f6fec8a93a84369c47d0427477d2dc0c66e1183368024a9b1eab15dbf4b92654c603916b3087d585ea2
7
- data.tar.gz: 181974f1a67dd047e3b34821158cf208460ddb4a7d103f185fbac227b3561ef1a605d9fdb59079af4868a2f1d920b3661eecc195624513d697944afc75fa1ee9
6
+ metadata.gz: 8efb15474d630c8a132de72b441f9b714a2a37a7732af1857ea238f8cc741e57437f9b79b73189b8ac474c639db12617d41b7f04b54dc4c5766437880fd95a29
7
+ data.tar.gz: 8b395cfaec9259eda8967f26b8944fdd512c9c368f7561a10e612b2a1e2e022de4c9ce6e03eb0f725c2581602aa99e1cd13a84d57e2e9063eea855088d757316
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.swp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'faraday', '~> 0.9.2'
4
+ gem 'multi_json', '~> 1.11', '>= 1.11.2'
5
+
6
+ group :development do
7
+ gem 'guard-rspec', require: false
8
+ end
data/Guardfile ADDED
@@ -0,0 +1,70 @@
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 %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.("routing/#{m[1]}_routing"),
51
+ rspec.spec.("controllers/#{m[1]}_controller"),
52
+ rspec.spec.("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
@@ -0,0 +1,3 @@
1
+ module MarsWeather
2
+ VERSION = "0.0.3"
3
+ end
data/lib/mars_weather.rb CHANGED
@@ -1,9 +1,15 @@
1
1
  require 'faraday'
2
2
  require 'multi_json'
3
3
 
4
+ # The Weather on Mars
4
5
  class MarsWeather
5
6
  URL = 'http://marsweather.ingenology.com/v1/latest/'
6
7
 
8
+ # Gets the latest weather on Mars.
9
+ #
10
+ # Example:
11
+ # >> MarsWeather.latest
12
+
7
13
  def self.latest
8
14
  response = Faraday.get(URL)
9
15
  return unless response
@@ -0,0 +1,11 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'mars_weather'
3
+ s.version = '0.0.2'
4
+ s.summary = 'Mars Weather'
5
+ s.description = 'The weather on Mars'
6
+ s.author = 'Andrey Kolbasov'
7
+ s.email = 'andrey@kolbasov.com'
8
+ s.files = `git ls-files`.split("\n")
9
+ s.homepage = 'http://rubygems.org/gems/mars_weather'
10
+ s.license = 'MIT'
11
+ end
@@ -0,0 +1,26 @@
1
+ require 'mars_weather'
2
+
3
+ RSpec.describe MarsWeather do
4
+ subject(:weather) { MarsWeather.latest }
5
+
6
+ it 'returns latest weather' do
7
+ expect(weather).not_to be nil
8
+ end
9
+
10
+ it { is_expected.to include(:terrestrial_date) }
11
+ it { is_expected.to include(:sol) }
12
+ it { is_expected.to include(:ls) }
13
+ it { is_expected.to include(:min_temp) }
14
+ it { is_expected.to include(:min_temp_fahrenheit) }
15
+ it { is_expected.to include(:max_temp) }
16
+ it { is_expected.to include(:max_temp_fahrenheit) }
17
+ it { is_expected.to include(:pressure) }
18
+ it { is_expected.to include(:pressure_string) }
19
+ it { is_expected.to include(:abs_humidity) }
20
+ it { is_expected.to include(:wind_speed) }
21
+ it { is_expected.to include(:wind_direction) }
22
+ it { is_expected.to include(:atmo_opacity) }
23
+ it { is_expected.to include(:season) }
24
+ it { is_expected.to include(:sunrise) }
25
+ it { is_expected.to include(:sunset) }
26
+ end
@@ -0,0 +1,96 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Allows RSpec to persist some state between runs in order to support
54
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
55
+ # you configure your source control system to ignore this file.
56
+ config.example_status_persistence_file_path = "spec/examples.txt"
57
+
58
+ # Limits the available syntax to the non-monkey patched syntax that is
59
+ # recommended. For more details, see:
60
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
61
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
62
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
63
+ config.disable_monkey_patching!
64
+
65
+ # This setting enables warnings. It's recommended, but in some cases may
66
+ # be too noisy due to issues in dependencies.
67
+ config.warnings = true
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = 'doc'
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+ =end
96
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mars_weather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kolbasov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-01-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The weather on Mars
14
14
  email: andrey@kolbasov.com
@@ -16,7 +16,15 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".gitignore"
20
+ - ".rspec"
21
+ - Gemfile
22
+ - Guardfile
19
23
  - lib/mars_weather.rb
24
+ - lib/mars_weather/version.rb
25
+ - mars_weather.gemspec
26
+ - spec/mars_weather_spec.rb
27
+ - spec/spec_helper.rb
20
28
  homepage: http://rubygems.org/gems/mars_weather
21
29
  licenses:
22
30
  - MIT
@@ -40,5 +48,6 @@ rubyforge_project:
40
48
  rubygems_version: 2.4.5.1
41
49
  signing_key:
42
50
  specification_version: 4
43
- summary: Mars
51
+ summary: Mars Weather
44
52
  test_files: []
53
+ has_rdoc: