alch 1.1.0 → 1.1.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
  SHA1:
3
- metadata.gz: a5a717f09f3e3633f57ceba0a5af9231d80b7d82
4
- data.tar.gz: 379058d588d603e5f32da3b8c17f57c5828f4b20
3
+ metadata.gz: f36ac89d85c1648f5362ab9a6897b973fb6895f6
4
+ data.tar.gz: e66ce5de6bff1c0d40b9c09b6ff90989666e837d
5
5
  SHA512:
6
- metadata.gz: f60af9f47e4c4bb6f267b64f0e6d3065d4ba5aad255167d330deb80d28e722b19ae5bad8a1b979a23c94a2d5eaf070a5059a5ba3341afcb4d761851c08975817
7
- data.tar.gz: 06c939bd88d4d9de6fcfed86819fafae9dbe216ca7313ae745ff7ce4c7f7185afdaa75004e3baa96e2111c1034c0012107020cc00025fcc13e5cb75c5a50fda3
6
+ metadata.gz: b597cf3f2a5ee2891fb3a6c0b9a2b4d7db2f28ba11aab4d200c7356073b3bf2e610b9c958303b25dc7c2735d5721264df5246d7d54400d47b2b9183f8479da1c
7
+ data.tar.gz: 744b5551e403863d6ef9b3336049d64cf9c2384986ad6ab13bc3f7047068161616a0796f20dacf4ad10ac11370684e7285e63c01bb664bd5d0551e863280a818
data/README.md CHANGED
@@ -24,8 +24,8 @@ A very basic use case:
24
24
  require 'alch'
25
25
 
26
26
  # Create ruby and nature rune items
27
- item = new Item(1603)
28
- nature_rune = new Item(Runes::NATURE_RUNE_ID)
27
+ item = Item.new(1603)
28
+ nature_rune = Item.new(Runes::NATURE_RUNE_ID)
29
29
 
30
30
  # output => 'Profit from alching Ruby: -692'
31
31
  print "Profit from alching #{item.name}: "
@@ -38,8 +38,8 @@ Alternatively, you can also get the Item's ID by the Item's name.
38
38
  require 'alch'
39
39
 
40
40
  # Create ruby and nature rune items
41
- item = new Item(Item.id_by_name('ruby'))
42
- nature_rune = new Item(Runes::NATURE_RUNE_ID)
41
+ item = Item.new(Item.id_by_name('ruby'))
42
+ nature_rune = Item.new(Runes::NATURE_RUNE_ID)
43
43
 
44
44
  # output => 'Profit from alching Ruby: -692'
45
45
  print "Profit from alching #{item.name}: "
@@ -47,4 +47,4 @@ puts item.high_alch - (item.price + nature_rune.price)
47
47
  ```
48
48
 
49
49
  # Full Documentation
50
- [View the Full Documentation](http://www.rubydoc.info/gems/alch/1.1.0)
50
+ [View the Full Documentation](http://www.rubydoc.info/gems/alch/1.1.1)
data/lib/alch.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Released under the MIT License agreement
3
3
 
4
4
  # @author RubySometimes (GitHub)
5
- # @version 1.0.5
5
+ # @version 1.1.1
6
6
  require_relative('alch/item')
7
7
  require_relative('alch/osrs')
8
- require_relative('alch/runes')
8
+ require_relative('alch/runes')
data/lib/alch/item.rb CHANGED
@@ -1,7 +1,7 @@
1
- require_relative('osrs')
2
- require_relative('runes')
3
- require('json')
4
- require('net/http')
1
+ require 'json'
2
+ require 'net/http'
3
+ require_relative 'osrs'
4
+ require_relative 'runes'
5
5
 
6
6
  # Items are anything that can be in your inventory.
7
7
  #
@@ -31,10 +31,8 @@ class Item
31
31
 
32
32
  # Creates a new Item object
33
33
  # @param [Integer] id - the id of the Item
34
- # @raise RunTimeError if the id is not an integer
35
34
  def initialize(id)
36
- raise 'Parameter id must be an Integer' unless id.instance_of? Integer
37
- @id = id
35
+ @id = id.to_i
38
36
  @name = generate_name
39
37
  @price = generate_price
40
38
  @store_price = generate_store
data/lib/alch/osrs.rb CHANGED
@@ -4,4 +4,4 @@ module OSRS
4
4
  GE_JSON = 'http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item='.freeze
5
5
  # Link to Shop Data
6
6
  SHOP_DATA = 'http://marchy.me/data/shop.json'.freeze
7
- end
7
+ end
data/lib/alch/runes.rb CHANGED
@@ -4,4 +4,4 @@ module Runes
4
4
  NATURE_RUNE_ID = 561
5
5
  # Fire Rune ID
6
6
  FIRE_RUNE_ID = 554
7
- end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcello A. Sabino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple way to determine alch prices on Oldschool Runescape
14
14
  email: march@marchy.me
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  version: '0'
42
42
  requirements: []
43
43
  rubyforge_project:
44
- rubygems_version: 2.6.13
44
+ rubygems_version: 2.5.2
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Grab OSRS Alch Prices