liblab_the_one 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 26956ba91f4879a09844057d5b0738c308793845c10bf181d2f0772ad534743a
4
- data.tar.gz: ffacc57af7e65676ed63a5ec1723273b7134ae4d3a8c9b16c9f46875651b4d7a
3
+ metadata.gz: 4a46278376323b078492b7eed5571cbaefbf3b2ffcd85c691ff20206e12c4b5f
4
+ data.tar.gz: c1e9cb7245773b9ae262a55088e5a28d0ddb263e5386c0148a2219579e38c9e7
5
5
  SHA512:
6
- metadata.gz: e98bdb3e2251d0233407bc2738c62ecebc50455fdde8cf37e6bd195f132692ce269df0be97f565c34d4cfa20e8af2ab04331fc3734b0cd0d872cc2fcf70a8d5b
7
- data.tar.gz: e461d819b73aaa5faf06888b96891ba4231eac84435b6d92f68086b8828a0b68e131e7f12547061036efa4b1202e7176e81fa778ab173f750e4c8df253ab7fc5
6
+ metadata.gz: 8124e96726f1c218b3dee540a7a10211c8306e598298ebe3b5215de8ca8b047e00bad0cf3af1aff46035e983ec8cbf8bb6db5473d1289e6d709809513ac6872d
7
+ data.tar.gz: dd4bbfe013e808f027fb2b66013760982c189b122ca090870cba55747c128df72eb9ba002b6a67128145fd7bc754e7d1ba085918b73d8649cb1ffbe1dfccf2fd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liblab_the_one (0.3.0)
4
+ liblab_the_one (0.3.1)
5
5
  rest-client (~> 2.1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -12,7 +12,7 @@ Add the following environment variables. You can request an `access_token` at ht
12
12
  LIBLAB_ACCESS_TOKEN=
13
13
  ```
14
14
 
15
- Add this line to your application's Gemfile:
15
+ Add this line to your application's Gemfile if using Ruby on Rails:
16
16
 
17
17
  ```ruby
18
18
  gem 'liblab_the_one'
@@ -22,10 +22,11 @@ And then execute:
22
22
 
23
23
  $ bundle install
24
24
 
25
- Or install it yourself as:
25
+ Or install it yourself in a ruby environment as:
26
26
 
27
27
  $ gem install pex_api
28
28
 
29
+
29
30
  After installing you can test by running `irb`, then `require "liblab"` and then running `Liblab::Movie::List.call()` This should return a list of movies.
30
31
 
31
32
  ## Usage
@@ -54,7 +55,7 @@ Example response is `{:quote=>"Your bodyguard?", :movie_name=>"The Two Towers"}`
54
55
 
55
56
  ## Development
56
57
 
57
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
59
 
59
60
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
60
61
 
@@ -5,7 +5,7 @@ module Liblab
5
5
  # Example returns {:quote=>"Your bodyguard?", :movie_name=>"The Two Towers"}
6
6
 
7
7
  def self.call()
8
- page = rand(2)
8
+ page = rand(1..2)
9
9
  _path = "quote?page=#{page}"
10
10
 
11
11
  # Get a random page of quotes
@@ -13,7 +13,7 @@ module Liblab
13
13
 
14
14
  if quote_result.code == 200
15
15
  # Get a random quote from returned quotes
16
- index = rand(999)
16
+ index = rand(1..999)
17
17
  quote = JSON.parse(quote_result.body)["docs"][index]
18
18
  movie_result = ::Liblab::Movie::Get.call(quote["movie"])
19
19
 
@@ -23,10 +23,10 @@ module Liblab
23
23
 
24
24
  return { quote: quote["dialog"], movie_name: movie["name"] }
25
25
  else
26
- return { error: "Could not get movie_result", message: movie_result.body }
26
+ return movie_result
27
27
  end
28
28
  else
29
- return { error: "Could not get quote", message: quote_result.body }
29
+ return quote_result
30
30
  end
31
31
  end
32
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Liblab
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liblab_the_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Monty Lennie