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 +4 -4
- data/README.md +5 -5
- data/lib/alch.rb +2 -2
- data/lib/alch/item.rb +5 -7
- data/lib/alch/osrs.rb +1 -1
- data/lib/alch/runes.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f36ac89d85c1648f5362ab9a6897b973fb6895f6
|
4
|
+
data.tar.gz: e66ce5de6bff1c0d40b9c09b6ff90989666e837d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
28
|
-
nature_rune = new
|
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
|
42
|
-
nature_rune = new
|
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.
|
50
|
+
[View the Full Documentation](http://www.rubydoc.info/gems/alch/1.1.1)
|
data/lib/alch.rb
CHANGED
data/lib/alch/item.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
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
data/lib/alch/runes.rb
CHANGED
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.
|
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-
|
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.
|
44
|
+
rubygems_version: 2.5.2
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: Grab OSRS Alch Prices
|