lacuna 0.0.5 → 0.0.6

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: 35b604b27e7413743e949ea81a99da2a6e5a721d
4
- data.tar.gz: e36511ee139b6d0ec184480bb264d7a419b8990f
3
+ metadata.gz: b1fb6c30f85f48ab7b6cb59c55af8707989b0bf1
4
+ data.tar.gz: 4d5a0f972c2c8ba68fb93defe86882f895bedc2d
5
5
  SHA512:
6
- metadata.gz: 375b1c0a48d3202fcb9cb09e45b12ebb89c65124553e29ff1cda8adf7f0b2ad04497b96ff398d78500ec33121e8262820011b2964727b32ef1fe5de668d5fd87
7
- data.tar.gz: 00796b6dbedfdf772f20f40278102a5fc2257baef1823b2def4f810c08fe07c1fa2d4a2ad30dc82cc3cc93422b62234af78a77e1885be8faa541a8c16557cd71
6
+ metadata.gz: 97ef45b85683ac522aba50473946b6a8919984594359c6c013ad8446fd52edc87d43cb49addf549b1cdca27a3c8300fe1b515aa5f7c85cbaae6eeffa22293b8e
7
+ data.tar.gz: 94a1cdeabcf51da50f8b304062f7c849eefa5f7b1c01d56584bd389d748757097247190d3c482f8bf38379e8a1d6078d3482ee1cba6def27006b4a242fe717ec
@@ -79,6 +79,10 @@ module Lacuna
79
79
  @module_name = 'captcha'
80
80
  end
81
81
 
82
+ class Archaeology < Lacuna::Extras::Archaeology
83
+ @module_name = 'archaeology'
84
+ end
85
+
82
86
  # Note: this has no support for building specific extras. I guess we could
83
87
  # just define them manually?
84
88
  Lacuna::Buildings.types.each do |name|
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ class Lacuna
4
+ class Extras
5
+ class Archaeology
6
+ def self.get_inventory(id)
7
+ glyphs = Lacuna::Archaeology.get_glyph_summary(id)['glyphs']
8
+ inventory = {}
9
+ glyphs.each do |glyph|
10
+ inventory[glyph['name']] = glyph['quantity'].to_i
11
+ end
12
+ inventory
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,7 +3,16 @@
3
3
  module Lacuna
4
4
  class Extras
5
5
  class Body < Lacuna::Module
6
-
6
+ def self.find_building(buildings, name)
7
+ building = buildings.select do |id, building|
8
+ # Save the id for later
9
+ buildings[id]['id'] = id
10
+ building['name'] == name
11
+ end
12
+ # Grab the first item in the hash.
13
+ building = building[building.keys[0]]
14
+ building
15
+ end
7
16
  end
8
17
  end
9
18
  end
@@ -3,7 +3,10 @@
3
3
  module Lacuna
4
4
  class Extras
5
5
  class Empire < Lacuna::Module
6
-
6
+ def self.planets
7
+ planets = Lacuna::Empire.get_status['status']['planets']
8
+ planets.select { |planet| !planet.match /^(S|Z)ASS/ }
9
+ end
7
10
  end
8
11
  end
9
12
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Lacuna
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacuna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan McCallum
@@ -19,6 +19,7 @@ files:
19
19
  - lib/lacuna.rb
20
20
  - lib/lacuna/constants.rb
21
21
  - lib/lacuna/extras/alliance.rb
22
+ - lib/lacuna/extras/archaeology.rb
22
23
  - lib/lacuna/extras/body.rb
23
24
  - lib/lacuna/extras/buildings.rb
24
25
  - lib/lacuna/extras/captcha.rb